Skip to main content

Conversion between QImages and numpy.ndarrays.

Project description

qimage2ndarray is a small python extension for quickly converting between QImages and numpy.ndarrays (in both directions). These are very common tasks when programming e.g. scientific visualizations in Python using PyQt4 as the GUI library.

  • Supports conversion of scalar and RGB data, with arbitrary dtypes and memory layout, with and without alpha channels, into QImages (e.g. for display or saving using Qt).

  • qimage2ndarray makes it possible to create ndarrays that are views into a given QImage’s memory.

    This allows for very efficient data handling and makes it possible to modify Qt image data in-place (e.g. for brightness/gamma or alpha mask modifications).

  • Masked arrays are also supported and are converted into QImages with transparent pixels.

  • Supports recarrays (and comes with an appropriate dtype) for convenient access to RGB(A) channels.

  • Supports value scaling / normalization to 0..255 for convenient display of arbitrary NumPy arrays.

  • qimage2ndarray is stable and unit-tested.

Project details


Download files

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

Source Distribution

qimage2ndarray-1.7.tar.gz (181.8 kB view details)

Uploaded Source

File details

Details for the file qimage2ndarray-1.7.tar.gz.

File metadata

  • Download URL: qimage2ndarray-1.7.tar.gz
  • Upload date:
  • Size: 181.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for qimage2ndarray-1.7.tar.gz
Algorithm Hash digest
SHA256 c8616fefcd725875ea614ab0976f0cfa4d7db3d12046ae8485370e91a50ab3b7
MD5 a99e5b7865ee2fd5d0e646fd4e1534ef
BLAKE2b-256 5fd330f03bc00a26fc538a834d58ac63c978aa8a8817a030567cc01763bf7617

See more details on using hashes here.

Supported by

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