Closed mesvam closed 8 months ago
Those are unfortunately expected and related to #1227 as the model fitting does not match exactly yield the input whitepoint which can be verified by converting Lightness J=100 to CIE XYZ:
import colour
print(
colour.xy_to_XYZ(
colour.CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"]["D65"]
)
)
XYZ = colour.sRGB_to_XYZ([1, 1, 1])
print(XYZ)
XYZ = colour.CIECAM02_to_XYZ(
colour.CAM_Specification_CIECAM02(100, 0, 0),
**colour.appearance.CAM_KWARGS_CIECAM02_sRGB
)
print(XYZ / XYZ[1])
XYZ = colour.CIECAM16_to_XYZ(
colour.CAM_Specification_CIECAM16(100, 0, 0),
**colour.appearance.CAM_KWARGS_CIECAM02_sRGB
)
print(XYZ / XYZ[1])
[ 0.95045593 1. 1.08905775]
[ 0.9505 1. 1.089 ]
[ 0.95854868 1. 1.07335032]
[ 0.95857463 1. 1.07307191]
Cheers,
Thomas
I don't quite understand. Are you saying this is a problem inherent in the model specification of CIECAM16? or just this specific package's implementation?
The model itself.
It's actually a pretty big difference, dE2000 > 2
import colour
CAM_white = colour.convert([1,0,0], 'CIECAM16 JMh', 'CIE XYZ')
sRGB_white = colour.convert([1,1,1], 'sRGB', 'CIE XYZ')
colour.difference.delta_E_CIE2000(
colour.convert(CAM_white, 'CIE XYZ', 'CIE Lab')*100,
colour.convert(sRGB_white, 'CIE XYZ', 'CIE Lab')*100,
)
2.2151311708854311
And it happens no matter the reference white point.
D50 = colour.TVS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']/100
CAM_white = colour.convert([1,0,0], 'CIECAM16 JMh', 'CIE XYZ', XYZ_w=D50)
colour.difference.delta_E_CIE2000(
colour.convert(D50, 'CIE XYZ', 'CIE Lab')*100,
colour.convert(CAM_white, 'CIE XYZ', 'CIE Lab')*100
)
1.6821909479182446
I'm pretty unnerved to be honest. Isn't the model supposed to use the given white point as the reference? How could it be so far off?
So what's the correct way of dealing with this if we actually want M=0 to correspond to the given white point? When I use discount_illuminant=True
, the value is much closer.
colour.convert([1,0,0], 'CIECAM16 JMh', 'sRGB', discount_illuminant=True)
array([ 0.99993111, 1.00004358, 1.00003272])
But is that the correct way to do it? I'm not sure what the interpretation is here.
Try setting D=1 in the cam call.
On Wed, Nov 29, 2023 at 6:46 PM mesvam @.***> wrote:
It's actually a pretty big difference, dE2000 > 2
import colour CAM_white = colour.convert([1,0,0], 'CIECAM16 JMh', 'CIE XYZ') sRGB_white = colour.convert([1,1,1], 'sRGB', 'CIE XYZ') colour.difference.delta_E_CIE2000( colour.convert(CAM_white, 'CIE XYZ', 'CIE Lab')100, colour.convert(sRGB_white, 'CIE XYZ', 'CIE Lab')100, ) 2.2151311708854311
And it happens no matter the reference white point.
D50 = colour.TVS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D50']/100 CAM_white = colour.convert([1,0,0], 'CIECAM16 JMh', 'CIE XYZ', XYZ_w=D50) colour.difference.delta_E_CIE2000( colour.convert(D50, 'CIE XYZ', 'CIE Lab')100, colour.convert(CAM_white, 'CIE XYZ', 'CIE Lab')100 ) 1.6821909479182446
I'm pretty unnerved to be honest. Isn't the model supposed to use the given white point as the reference? How could it be so far off?
So what's the correct way of dealing with this if we actually want M=0 to correspond to the given white point? When I use discount_illuminant=True, the value is much closer.
colour.convert([1,0,0], 'CIECAM16 JMh', 'sRGB', discount_illuminant=True) array([ 0.99993111, 1.00004358, 1.00003272])
But is that the correct way to do it?
— Reply to this email directly, view it on GitHub https://github.com/colour-science/colour/issues/1228#issuecomment-1833020576, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABS4J5UR5OBCQRDSSED2JR3YG7XRPAVCNFSM6AAAAAA7WNFNT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTGAZDANJXGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Closing this one as there is not much to be done!
Description
Shouldn't C = M = s = 0 for white?
Likewise, the reverse conversion doesn't return white in sRGB
This happens even if whitepoint is explicitly specified
Environment Information