Skip to content

Best Way to Sample Points in Chromaticity Diagram #910

Answered by KelSolaar
Jerry2001 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Jerry2001,

You could sample in CIE Luv uv space directly, convert to RGB, remove out-of-gamut RGB values and display the remaining colours:

>>> import colour
>>> import numpy as np
>>> uv = np.random.rand(65535, 2)
>>> RGB = colour.convert(uv, 'CIE Luv uv', 'RGB', verbose={'mode': 'Long'})
===============================================================================
*                                                                             *
*   [ Conversion Path ]                                                       *
*                                                                             *
*   "uv_to_Luv" --> "Luv_to_XYZ" --> "XYZ_to_RGB"                             *
*

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Jerry2001
Comment options

@KelSolaar
Comment options

Answer selected by Jerry2001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants