Пример #1
0
"""Showcases RGB colourspace volume computations."""

import colour
from colour.utilities import message_box

# NOTE: Because the MonteCarlo methods use multiprocessing, it is recommended
# to wrap the execution in a definition or a *__main__* block.
if __name__ == "__main__":
    message_box("RGB Colourspace Volume Computations")

    message_box('Computing the "ProPhoto RGB" RGB colourspace limits.')
    limits = colour.RGB_colourspace_limits(
        colour.RGB_COLOURSPACES["ProPhoto RGB"])
    print(limits)

    print("\n")

    samples = 10e4
    message_box(
        f'Computing the"ProPhoto RGB" RGB colourspace volume using {samples} '
        f"samples.")
    print(
        colour.RGB_colourspace_volume_MonteCarlo(
            colour.RGB_COLOURSPACES["ProPhoto RGB"],
            samples=samples,
            limits=limits * 1.1,
        ))

    print("\n")

    message_box(f'Computing "ProPhoto RGB" RGB colourspace coverage of '
Пример #2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Showcases RGB colourspace volume computations.
"""

from __future__ import division, unicode_literals

import colour
from colour.utilities.verbose import message_box

message_box('RGB Colourspace Volume Computations')

message_box('Computing "ProPhoto RGB" RGB colourspace limits.')
limits = colour.RGB_colourspace_limits(colour.PROPHOTO_RGB_COLOURSPACE)
print(limits)

print('\n')

samples = 10e4
message_box(('Computing "ProPhoto RGB" RGB colourspace volume using '
             '{0} samples.'.format(samples)))
print(
    colour.RGB_colourspace_volume_MonteCarlo(colour.PROPHOTO_RGB_COLOURSPACE,
                                             samples=samples,
                                             limits=limits * 1.1))

print('\n')

message_box(('Computing "ProPhoto RGB" RGB colourspace coverage of Pointer\'s '
             'Gamut using {0} samples.'.format(samples)))