Created
December 20, 2017 09:15
-
-
Save Collonville/5b9aa1f1abac44c459414d781bc5ef18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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