Replies: 5 comments
-
Hi @NoRoKr, It should be doable as follows: # %%
import numpy as np
from collections import OrderedDict
import colour
import colour.plotting
CRC = np.array([
[0.4002, 0.3504, 0.1005],
[0.3773, 0.3446, 0.3582],
[0.2470, 0.2514, 0.1933],
[0.3372, 0.4220, 0.1329],
[0.2651, 0.2400, 0.2427],
[0.2608, 0.3430, 0.4306],
[0.5060, 0.4070, 0.3005],
[0.2110, 0.1750, 0.1200],
[0.4533, 0.3058, 0.1977],
[0.2845, 0.2020, 0.0656],
[0.3800, 0.4887, 0.4429],
[0.4729, 0.4375, 0.4306],
[0.1866, 0.1285, 0.0611],
[0.3046, 0.4782, 0.2339],
[0.5385, 0.3129, 0.1200],
[0.4480, 0.4703, 0.5910],
[0.3635, 0.2325, 0.1977],
[0.1958, 0.2519, 0.1977],
[0.3101, 0.3163, 0.9001],
[0.3101, 0.3163, 0.5910],
[0.3101, 0.3163, 0.3620],
[0.3101, 0.3163, 0.1977],
[0.3101, 0.3163, 0.0900],
[0.3101, 0.3163, 0.0313]
])
CRC += (np.random.random(CRC.shape) - 0.5) * 0.075
# CRC plots.
colour_checker_t = colour.characterisation.ColourChecker(
'Test', OrderedDict([(str(i), x) for i, x in enumerate(CRC)]),
colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['C'])
colour.plotting.plot_multi_colour_checkers(['ColorChecker 1976', colour_checker_t]) Did you have anything else in mind? |
Beta Was this translation helpful? Give feedback.
-
Hi @KelSolaar, I do have a few concerns that I believe could be improved upon here. I could move these into a separate issue if necessary.
First, the requirement to rescale the data seems like it shouldn't be necessary by default. Second, this outputs the following image: There's a clear issue with the color in the converted one. Perhaps I am missing a necessary parameter to have CC rendered correctly in sRGB? |
Beta Was this translation helpful? Give feedback.
-
With regards to my last comment, I forgot the basics of color for a second and see my mistake (not incorporating the light source correctly)! |
Beta Was this translation helpful? Give feedback.
-
Hi @NoRoKr, That is what I was about to say! You need to pass the illuminant to the spectral conversion function :] In respect to the division by 100, there is a good reason why it is not the default: https://colour.readthedocs.io/en/develop/basics.html#domain-range-scales By default, the conversion from spectral to tristimulus values generates percentages, i.e. reflectance, transmittance or absorptance percentages. |
Beta Was this translation helpful? Give feedback.
-
sd_to_xyY = lambda sd : colour.XYZ_to_xyY(colour.sd_to_XYZ(sd, illuminant=ls) / 100 ) This fixes my previous problem |
Beta Was this translation helpful? Give feedback.
-
From my investigations, it does not seem that colour allows creation of COLOURCHECKERS or COLOURCHECKERS_SDS objects defined by the user.
Preferably, a user who has access to a colorimeter or spectroradiometer could measure their own Macbeth charts either to evaluate the measurement equipment or the quality of charts and display them using
colour.plotting.plot_multi_colour_checkers
.Currently, I am able to plot each individual patch using the
plot_multi_colour_swatches
function, but there are a number of occasions where having the entire color checker chart in one go would be nice.Beta Was this translation helpful? Give feedback.
All reactions