Skip to content

Creates a random colormap to be used together with matplotlib. Useful for segmentation tasks

License

Notifications You must be signed in to change notification settings

delestro/rand_cmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Attention

This repository is deprecated and not being updated anymore.

The code was integrated into the qim3d library, with some extra features: https://platform.qim.dk/qim3d/viz/#qim3d.viz.colormaps.objects

You can install with pip install qim3d

And easily create a colormap:

import qim3d
cmap = qim3d.viz.colormaps.objects(nlabels=100, style='bright', first_color_background=True, background_color="black")

rand_cmap

Creates a custom random colormap to be used together with matplotlib, useful for segmentation tasks. You may choose the first or last colors to be black. Also, two types of colormap can be generated, 'bright' and 'soft'. On both cases, the generated colors are restricted to never be too bright or too dark.

keywords: python, ipython, matplotlib, plt, color map, random, colors, segmentation

Examples:

Bright colors

Generating a colormap for 100 labels, with first as black

new_cmap = rand_cmap(100, type='bright', first_color_black=True, last_color_black=False, verbose=True)

alt tag

Soft colors

Generating a colormap for 50 labels, with last as black

new_cmap = rand_cmap(50, type='soft', first_color_black=False, last_color_black=True, verbose=True)

alt tag

About

Creates a random colormap to be used together with matplotlib. Useful for segmentation tasks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages