Skip to main content

Generate a colormap from an image

Project description

https://img.shields.io/badge/Made%20at-%23AstroHackWeek-8063d5.svg?style=flat

About

This is a small package to easily generate colormaps from images which was built as a fun hack and should not be used to generate colormaps for serious visualization work since there is no guarantee that the colormaps made will be e.g. perceptually uniform.

Installing

To install:

pip install colormapize

Using

To use, run:

colormapize your_image.jpg colormap_name

where colormap_name is what you want to call your colormap, for example:

colormapize your_image.jpg kittens

This should open a Matplotlib window. Click once to define the start of a path and click again to define the end of the path. You can then use the + and - keys to add more samples along the path. If you are not happy with the path, just click twice again to define a new path. Once you are happy with it, press ‘enter’ or ‘c’ and you will see a preview of the colormap on the right of the image, and the colormap will also be saved to e.g.``cmap_kittens.py``. You can continue to redefine the path until you are happy with it, and the file will be overwritten every time you press ‘enter’ or ‘c’. Close the window once you are done.

To use, make sure the colormap file (e.g. cmap_kittens.py) is in the same directory as the directory where you want to make plots, and you can then use it as follows in other scripts:

import colormap_kittens

...

plt.imshow(mydata, cmap='kittens')

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

colormapize-0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

colormapize-0.2-py2.py3-none-any.whl (4.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file colormapize-0.2.tar.gz.

File metadata

  • Download URL: colormapize-0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for colormapize-0.2.tar.gz
Algorithm Hash digest
SHA256 eff46864f28c6a4526ba927edd7c03cfd8e6a573270521e6ea653322f0eab57b
MD5 02b1490344787629a0aa9b020451b55f
BLAKE2b-256 6a71a73535546c5f56be5e9f108a71554e4525bfdfa76c8cf2695711be6121a5

See more details on using hashes here.

File details

Details for the file colormapize-0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: colormapize-0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for colormapize-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 228f8327c17e028b3cb8100853c951145d7c68a38e66c17fc24aeae77d7ad28e
MD5 575472dd813f5885b4eb1ae73c72256b
BLAKE2b-256 13fc69a6642e5edbcff1541595801332b5a0465671175cf611c36dc69bd47003

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