How do I plot sRGB gamut slice with colorio?

268 Views Asked by At

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):

this

Here I encountered two problems:

  1. 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 of matplotlib)
  2. 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()
0

There are 0 best solutions below