I want to plot the Mac Adam ellipses in different color spaces. For convenience I would like to show the possible sRGB Gamut too. Just like in this image (which is made with the colorio
package too):
Here I encountered two problems:
- I don't know how to add the sRGB slice to the plot (it seems to use a different package for 3D plotting - namely
pyvista
instead ofmatplotlib
) - I'm not sure if this is a bug in the package because the given slice of the sRGB Gamut is not made in the Y axis but in x.
colorio.plot_rgb_slice(cs, .2).show()
My code:
#!/usr/bin/env python3
import colorio
# colorspace
cs = colorio.cs.XYY1()
# Mac Adam ellipses
ellipses = colorio.data.MacAdam1942(1)
ellipses.plot(lambda: cs, ellipse_scaling=10)
# visible slice of xyY (works fine)
plt = colorio.plot_visible_slice(cs, 1)
# gamut slice of sRGB (no idea how to make this work)
# 0.2 value is necessary to be not out of range here due to the slice in x axis instead of Y for some reason
colorio.plot_rgb_slice(cs, .2)
plt.show()