Skip to main content

npimage: Load, save & manipulate numpy arrays representing images & videos

Tests codecov PyPI version PyPI downloads License

Need to load pixel values from image files as numpy arrays, and hate having to remember whether you should use PIL, tifffile, matplotlib, or something else? Hate having to deal with the fact that those libraries all use different function names and syntaxes? Wish you could just provide a filename and get back a numpy array? This library's imageio.py does that, with array = npimage.load(filename), npimage.save(array, filename), and npimage.show(array) functions that let you easily handle a number of common image file formats without having to remember library-specific syntax. Additionally, vidio.py provides array = npimage.load_video(filename) and npimage.save_video(array, filename) for videos as well. (Another similar library to consider using is imageio.)

Want to draw simple shapes like lines, triangles, and circles into 3D numpy arrays? Frustrated that the python libraries you can find online like opencv and skimage.draw work on 2D arrays but not 3D/4D/+? I wrote some functions in graphics.py that do the trick.

Documentation

  • imageio.py: load, save, or show images.
  • vidio.py: load or save videos.
  • graphics.py: draw points, lines, triangles, circles, or spheres into 2D/3D/+D numpy arrays representing image data.
  • nrrd_utils.py: compress or read metadata from .nrrd files.
  • operations.py: perform operations on images.

Check each function's docstring for more details.

Installation

As is always the case in python, consider making a virtual environment (using your preference of conda, virtualenv, or virtualenvwrapper) before installing.

Option 1: pip install from PyPI:

pip install numpyimage
pip install 'numpyimage[vid]'  # If you also want to install the video loading/saving dependencies
pip install 'numpyimage[align]'  # If you also want to install the image alignment dependencies
pip install 'numpyimage[all]'  # If you want to install both video and alignment dependencies

(Unfortunately the name npimage was already taken on PyPI, so pip install npimage will get you a different package.)

Option 2: pip install directly from GitHub:

pip install git+https://github.com/jasper-tms/npimage.git

Option 3: First git clone this repo and then pip install it from your clone:

cd ~/repos  # Or wherever on your computer you want to download this code to
git clone https://github.com/jasper-tms/npimage.git
cd npimage
pip install '.[all]'

After installing, you can import this package in python using import npimage (not import numpyimage!)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numpyimage-3.10.0.tar.gz (64.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

numpyimage-3.10.0-py3-none-any.whl (55.1 kB view details)

Uploaded Python 3

File details

Details for the file numpyimage-3.10.0.tar.gz.

File metadata

  • Download URL: numpyimage-3.10.0.tar.gz
  • Upload date:
  • Size: 64.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for numpyimage-3.10.0.tar.gz
Algorithm Hash digest
SHA256 69f7b8ea511fa5492a23dfbf75bbe5a064d8b561a2edf9b984a3592b5729b1b9
MD5 604cecad632cfc753e602652922df1c3
BLAKE2b-256 957c8f951ec23891d4f91f37ea796025074516b23fcd80066b09f8ffb7e7a780

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpyimage-3.10.0.tar.gz:

Publisher: publish.yml on jasper-tms/npimage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numpyimage-3.10.0-py3-none-any.whl.

File metadata

  • Download URL: numpyimage-3.10.0-py3-none-any.whl
  • Upload date:
  • Size: 55.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for numpyimage-3.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e02fd03f1cb5cc44c5f140bb484dcae377cf57fafc4596c025eccfd4e918064b
MD5 6a251eaa7f0da75d106e58b34886937e
BLAKE2b-256 7d4688cd274a848643b9bcbe24253308a2f01ca7b81c3ce5225e33e92d521ff7

See more details on using hashes here.

Provenance

The following attestation bundles were made for numpyimage-3.10.0-py3-none-any.whl:

Publisher: publish.yml on jasper-tms/npimage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.10.0 This release

2 files

3.9.0

2 files

3.8.2

2 files

3.8.1

2 files

3.8.0

2 files

3.7.1

2 files

3.7.0

2 files

3.6.3

2 files

3.6.2

2 files

3.6.1

2 files

3.6.0

2 files

3.5.3

2 files

3.5.2

2 files

3.5.1

2 files

3.5.0

2 files

3.4.2

2 files

3.4.1

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.9.0

2 files

2.8.0

2 files

2.7.0

2 files

2.6.4

2 files

2.6.3

2 files

2.6.2

2 files

2.6.1

2 files

2.6.0

2 files

2.5.0

2 files

2.4.3

2 files

2.4.2

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page