Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de5906f

Browse files
committed
removed Lfunction since it is outdated and also removed that part from the docs. Changed grayscale plot to use colorspacious CAM02-UCS instead of CIELAB
1 parent 6756c81 commit de5906f

File tree

3 files changed

+3
-174
lines changed

3 files changed

+3
-174
lines changed

doc/users/colormaps.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,6 @@ extension on this idea at [mycarta-jet]_.
126126

127127
.. plot:: users/plotting/colormaps/lightness.py
128128

129-
130-
:math:`L^*` function
131-
====================
132-
133-
There are multiple approaches to finding the best function for :math:`L^*`
134-
across a colormap. Linear gives reasonable results (*e.g.*, [mycarta-banding]_,
135-
[mycarta-lablinear]_). However, the Weber-Fechner law, and more generally and
136-
recently, Stevens' Law, indicates that a logarithmic or geometric relationship
137-
might be better (see effort on this front at [mycarta-cubelaw]_).
138-
139-
.. plot:: users/plotting/colormaps/Lfunction.py
140-
141-
142129
Grayscale conversion
143130
====================
144131

doc/users/plotting/colormaps/Lfunction.py

Lines changed: 0 additions & 157 deletions
This file was deleted.

doc/users/plotting/colormaps/grayscale.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Uses lightness L* as a proxy for grayscale value.
44
'''
55

6-
import colorconv as color
7-
86
from colormaps import cmaps
97

108
#from skimage import color
@@ -14,6 +12,7 @@
1412
import matplotlib.pyplot as plt
1513
from matplotlib import cm
1614
import matplotlib as mpl
15+
from colorspacious import cspace_converter
1716

1817
mpl.rcParams.update({'font.size': 14})
1918

@@ -37,8 +36,8 @@ def plot_color_gradients(cmap_category, cmap_list):
3736
# Get rgb values for colormap
3837
rgb = cm.get_cmap(plt.get_cmap(name))(x)[np.newaxis,:,:3]
3938

40-
# Get colormap in CIE LAB. We want the L here.
41-
lab = color.rgb2lab(rgb)
39+
# Get colormap in CAM02-UCS colorspace. We want the lightness.
40+
lab = cspace_converter("sRGB1", "CAM02-UCS")(rgb)
4241
L = lab[0,:,0]
4342
L = np.float32(np.vstack((L, L, L)))
4443

0 commit comments

Comments
 (0)