colour.RGB_colourspace_volume_MonteCarlo#

colour.RGB_colourspace_volume_MonteCarlo(colourspace: RGB_Colourspace, samples: int = 1000000, limits: ArrayLike = np.array([[0, 100], [-150, 150], [-150, 150]]), illuminant_Lab: ArrayLike = CCS_ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65'], chromatic_adaptation_transform: Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02', 'CAT02 Brill 2008', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'] | str | None = 'CAT02', random_generator: Callable = random_triplet_generator, random_state: RandomState | None = None) float[source]#

Perform given RGB colourspace volume computation using Monte Carlo method and multiprocessing.

Parameters:
  • of. (colourspace RGB colourspace to compute the volume) –

  • count. (samples Sample) –

  • volume. (limits CIE L*a*b* colourspace) –

  • coordinates. (illuminant_Lab CIE L*a*b* colourspace illuminant chromaticity) –

  • method. (chromatic_adaptation_transform Chromatic adaptation) –

  • the (random_generator Random triplet generator providing the random samples within) – CIE L*a*b* colourspace volume.

  • random (random_state Mersenne Twister pseudo-random number generator to use in the) – number generator.

  • colourspace (RGB_Colourspace) –

  • samples (int) –

  • limits (ArrayLike) –

  • illuminant_Lab (ArrayLike) –

  • chromatic_adaptation_transform (Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02', 'CAT02 Brill 2008', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'] | str | None) –

  • random_generator (Callable) –

  • random_state (RandomState | None) –

Returns:

RGB colourspace volume.

Return type:

float

Notes

Examples

>>> from colour.models import RGB_COLOURSPACE_sRGB as sRGB
>>> from colour.utilities import disable_multiprocessing
>>> prng = np.random.RandomState(2)
>>> with disable_multiprocessing():
...     RGB_colourspace_volume_MonteCarlo(sRGB, 10e3, random_state=prng)
... 
...
8...