Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import itertools
import numpy as np
import matplotlib.pyplot as plt
import colour
from colour.plotting import *
#RGBを0.0~0.1の間隔で分割し、組み合わせを列挙
line = np.linspace(0.0, 1.0, 15, endpoint=True)
rgb = np.array(list(itertools.product(line,line,line)), dtype=np.float)
#sRGBからXYZへ変換
XYZ = colour.sRGB_to_XYZ(rgb)
#XYZからxyへ変換
xy = colour.XYZ_to_xy(XYZ)
CIE_1931_chromaticity_diagram_plot(bounding_box=(-0.1, 0.9, -0.1, 0.9), standalone=False)
#sRGB領域へプロット
plt.plot(xy[:,0], xy[:,1], 'o', markersize=2, label="sRGB")
plt.legend()
display(standalone=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.