-
DescriptionHello, I have found a weird behaviour with the Should a "no-op" check be added that if Code for Reproductionimport colour
import numpy
from numpy.testing import assert_array_equal
source = numpy.array([1 / 3, 1.26, -0.213])
colorspace = colour.models.RGB_COLOURSPACES["sRGB"]
result = colour.RGB_to_RGB(
RGB=source,
input_colourspace=colorspace,
output_colourspace=colorspace,
apply_cctf_decoding=True,
apply_cctf_encoding=True,
)
assert_array_equal(result, source) Exception MessageAssertionError:
Arrays are not equal
Mismatched elements: 3 / 3 (100%)
Max absolute difference: 0.00026099902984499934
Max relative difference: 0.0012253475579577435
x: array([ 0.333331, 1.260023, -0.212739])
y: array([ 0.333333, 1.26 , -0.213 ]) Environment Information===============================================================================
* *
* Interpreter : *
* python : 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC *
* v.1929 64 bit (AMD64)] *
* *
* colour-science.org : *
* colour : 0.4.1 *
* *
* Runtime : *
* imageio : 2.26.0 *
* numpy : 1.24.2 *
* PyOpenColorIO : 2.1.0 *
* scipy : 1.10.1 *
* OpenImageIO : 2.2.18 *
* *
=============================================================================== |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @MrLixm, As crazy as it might sound, this is "by-design", some standards, e.g. IEC 61966-2-1:1999, define the RGB to XYZ and XYZ to RGB matrices rounded at 4 digits, thus it cannot roundtrip properly. There is actually a long explanation at the top of the See also #282 for some discussion around that, there might be some more in the depth of Slack. Cheers, Thomas |
Beta Was this translation helpful? Give feedback.
Hi @MrLixm,
As crazy as it might sound, this is "by-design", some standards, e.g. IEC 61966-2-1:1999, define the RGB to XYZ and XYZ to RGB matrices rounded at 4 digits, thus it cannot roundtrip properly. There is actually a long explanation at the top of the
RGB_Colourspace
class: https://colour.readthedocs.io/en/develop/generated/colour.RGB_Colourspace.html#colour.RGB_ColourspaceSee also #282 for some discussion around that, there might be some more in the depth of Slack.
Cheers,
Thomas