grayify_colormap¶
-
gammapy.image.
grayify_colormap
(cmap, mode='hsp')[source]¶ Return a grayscale version a the colormap.
The grayscale conversion of the colormap is bases on perceived luminance of the colors. For the conversion either the
rgb2gray
or a generic method calledhsp
[1] can be used. The code is loosely based on [2].Parameters: - cmap : str or
Colormap
Colormap name or instance.
- mode : {‘skimage, ‘hsp’}
Grayscale conversion method. Either
skimage
orhsp
.
References
[1] Darel Rex Finley, “HSP Color Model - Alternative to HSV (HSB) and HSL” http://alienryderflex.com/hsp.html [2] Jake VanderPlas, “How Bad Is Your Colormap?” https://jakevdp.github.io/blog/2014/10/16/how-bad-is-your-colormap/ - cmap : str or