colour.RGB_colourspace_volume_MonteCarlo

colour.RGB_colourspace_volume_MonteCarlo(colourspace, samples=10000000.0, limits=array([[ 0., 100.], [-150., 150.], [-150., 150.]]), illuminant_Lab=array([ 0.3127, 0.329 ]), chromatic_adaptation_method='CAT02', random_generator=<function random_triplet_generator>, random_state=None)[source]

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

Parameters:
  • colourspace (RGB_Colourspace) – RGB colourspace to compute the volume of.
  • samples (numeric, optional) – Samples count.
  • limits (array_like, optional) – CIE L*a*b* colourspace volume.
  • illuminant_Lab (array_like, optional) – CIE L*a*b* colourspace illuminant chromaticity coordinates.
  • chromatic_adaptation_method (unicode, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02_BRILL_CAT’, ‘Bianco’, ‘Bianco PC’}, Chromatic adaptation method.
  • random_generator (generator, optional) – Random triplet generator providing the random samples within the CIE L*a*b* colourspace volume.
  • random_state (RandomState, optional) – Mersenne Twister pseudo-random number generator to use in the random number generator.
Returns:

RGB colourspace volume.

Return type:

float

Notes

Examples

>>> from colour.models import sRGB_COLOURSPACE 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)
... # doctest: +ELLIPSIS
8...