From 8e7afb77af406cfa778ef71f0c0bdf77f759b3c4 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Mon, 22 Apr 2024 15:51:47 +1200 Subject: [PATCH] Add `EPSILON` to primaries in `colour_visuals.VisualRGBColourspace2D` class to avoid singularities. --- colour_visuals/rgb_colourspace.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/colour_visuals/rgb_colourspace.py b/colour_visuals/rgb_colourspace.py index eebe35e..4148377 100644 --- a/colour_visuals/rgb_colourspace.py +++ b/colour_visuals/rgb_colourspace.py @@ -171,10 +171,9 @@ def update(self): XYZ_to_ij = METHODS_CHROMATICITY_DIAGRAM[self._method]["XYZ_to_ij"] ij = XYZ_to_ij( - xy_to_XYZ(self._colourspace.primaries), + xy_to_XYZ(self._colourspace.primaries + EPSILON), plotting_colourspace.whitepoint, ) - ij[np.isnan(ij)] = 0 positions = append_channel( np.array([ij[0], ij[1], ij[1], ij[2], ij[2], ij[0]]), 0