Skip to main content

Unmap data from pseudocolor images.

Project description

unmap

Run tests Build docs PyPI version PyPI versions PyPI license

Unmap data from pseudocolor images, with knowledge of the colourmap (for now!).

Installation

You can install this package with pip:

pip install unmap

Documentation

Read the documentation

Example

We'll grab an image from the web and unmap it:

def get_image_from_web(uri):
    data = requests.get(uri).content
    img = Image.open(BytesIO(data)).convert('RGB')
    rgb_im = np.asarray(img)[..., :3] / 255.
    return rgb_im

# An image from Matteo Niccoli's blog:
# https://mycartablog.com/2014/08/24/what-your-brain-does-with-colours-when-you-are-not-looking-part-1/
img = get_image_from_web('https://i0.wp.com/mycartablog.com/wp-content/uploads/2014/03/spectrogram_jet.png')

import gio

data = gio.unmap(img, cmap='jet')
plt.imshow(data)

Testing

You can run the tests (requires pytest and pytest-cov) with

pytest

Building

This repo uses PEP 517-style packaging. Read more about this and about Python packaging in general.

Building the project requires build, so first:

pip install build

Then to build unmap locally:

python -m build

The builds both .tar.gz and .whl files, either of which you can install with pip.

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

unmap-0.1.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

unmap-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file unmap-0.1.0.tar.gz.

File metadata

  • Download URL: unmap-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for unmap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48d88fcbff6fea0455b683d5231f7ca73478fdf521075af02fe77fb64ca7df3c
MD5 274c45026c211c9eb1a691588fead07b
BLAKE2b-256 780d232e9535c89c23f1950a9ee5026a05a54f6dc34d3087ea0761375786a747

See more details on using hashes here.

File details

Details for the file unmap-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: unmap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for unmap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f91bde94cbc60a016323414d726d1b7a7c875b9a516ae8ed76d8b71d32e6666
MD5 5879a16cfe7a75b9a51ff69a9911ad00
BLAKE2b-256 3d5dc8be7ce517d4b3071f85ead6c37520d2962273e00f549bd91aff8d373f07

See more details on using hashes here.

Supported by

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