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: Optional[Union[Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02 Brill 2008', 'CAT02', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'], str]] = 'CAT02', random_generator: Callable = random_triplet_generator, random_state: Optional[RandomState] = 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 Samples) –

  • 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 (Optional[Union[Literal['Bianco 2010', 'Bianco PC 2010', 'Bradford', 'CAT02 Brill 2008', 'CAT02', 'CAT16', 'CMCCAT2000', 'CMCCAT97', 'Fairchild', 'Sharp', 'Von Kries', 'XYZ Scaling'], str]]) –

  • random_generator (Callable) –

  • random_state (Optional[RandomState]) –

Returns:

RGB colourspace volume.

Return type:

numpy.floating

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...