Generate a colormap from an image
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.
pip install colormapize
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')
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size colormapize-0.2-py2.py3-none-any.whl (4.6 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size colormapize-0.2.tar.gz (3.8 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for colormapize-0.2-py2.py3-none-any.whl