Esempio n. 1
0
print(('\nNormalised primary matrix to "CIE XYZ" '
       'tristimulus values:\n{0}').format(colourspace.RGB_to_XYZ_matrix))
print('\nNormalised primary matrix to "ACES2065-1":\n{0}'.format(
    colourspace.XYZ_to_RGB_matrix))
print('\nOpto-electronic transfer function from '
      'linear to colourspace:\n{0}'.format(colourspace.encoding_cctf))
print('\nElectro-optical transfer function from '
      'colourspace to linear:\n{0}'.format(colourspace.decoding_cctf))

print('\n')

message_box(
    ('Computing "ACES2065-1" colourspace to "ITU-R BT.709" colourspace '
     'matrix.'))
cat = colour.chromatic_adaptation_matrix_VonKries(
    colour.xy_to_XYZ(colourspace.whitepoint),
    colour.xy_to_XYZ(colour.RGB_COLOURSPACES['ITU-R BT.709'].whitepoint))
print(
    np.dot(colour.RGB_COLOURSPACES['ITU-R BT.709'].XYZ_to_RGB_matrix,
           np.dot(cat, colourspace.RGB_to_XYZ_matrix)))

print('\n')

RGB = np.array([0.45620519, 0.03081071, 0.04091952])
message_box(
    ('Converting from "ITU-R BT.709" colourspace to "ACEScg" colourspace '
     'given "RGB" values:\n'
     '\n\t{0}'.format(RGB)))
print(
    colour.RGB_to_RGB(
        RGB,
Esempio n. 2
0
"""

from __future__ import division, unicode_literals

import colour
from colour.utilities.verbose import message_box

message_box('Von Kries Chromatic Adaptation Model Computations')

XYZ_w = (1.09846607, 1., 0.3558228)
XYZ_wr = (1.09846607, 1., 0.3558228)
message_box(('Computing the chromatic adaptation matrix from two source '
             '"CIE XYZ" matrices, default CAT is "CAT02".\n'
             '\n\t"XYZ_w":\n\t\t{0}\n\t"XYZ_wr":\n\t\t{1}'.format(
    XYZ_w, XYZ_wr)))
print(colour.chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr))

print('\n')

message_box('Using "Bradford" CAT.')
print(colour.chromatic_adaptation_matrix_VonKries(
    XYZ_w, XYZ_wr, transform='Bradford'))

print('\n')

message_box(('Computing the chromatic adaptation matrix from '
             '"CIE Standard Illuminant A" to '
             '"CIE Standard Illuminant D Series D65" using Von Kries CAT.'))
A = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['A']
D65 = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65']
print(colour.chromatic_adaptation_matrix_VonKries(
Esempio n. 3
0
"""
Showcases *Von Kries* chromatic adaptation model computations.
"""

import colour
from colour.utilities.verbose import message_box

message_box('"Von Kries" Chromatic Adaptation Model Computations')

XYZ_w = (1.09846607, 1.00000000, 0.35582280)
XYZ_wr = (1.09846607, 1.00000000, 0.35582280)
message_box(('Computing the chromatic adaptation matrix from two source '
             '"CIE XYZ" tristimulus values arrays, default CAT is "CAT02".\n'
             '\n\t"XYZ_w":\n\t\t{0}\n\t"XYZ_wr":\n\t\t{1}'.format(
                XYZ_w, XYZ_wr)))
print(colour.chromatic_adaptation_matrix_VonKries(XYZ_w, XYZ_wr))

print('\n')

message_box('Using "Bradford" CAT.')
print(colour.chromatic_adaptation_matrix_VonKries(
    XYZ_w, XYZ_wr, transform='Bradford'))

print('\n')

message_box(('Computing the chromatic adaptation matrix from '
             '"CIE Standard Illuminant A" to '
             '"CIE Standard Illuminant D Series D65" using "Von Kries" CAT.'))
A = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['A']
D65 = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['D65']
print(colour.chromatic_adaptation_matrix_VonKries(
Esempio n. 4
0
print('Name:\n"{0}"'.format(colourspace.name))
print('\nPrimaries:\n{0}'.format(colourspace.primaries))
print('\nNormalised primary matrix to "CIE XYZ":\n{0}'.format(
    colourspace.RGB_to_XYZ_matrix))
print('\nNormalised primary matrix to "ACES2065-1":\n{0}'.format(
    colourspace.XYZ_to_RGB_matrix))
print('\nTransfer function from linear to colourspace:\n{0}'.format(
    colourspace.transfer_function))
print('\nInverse transfer function from colourspace to linear:\n{0}'.format(
    colourspace.inverse_transfer_function))

print('\n')

message_box('Computing "ACES2065-1" colourspace to "sRGB" colourspace matrix.')
cat = colour.chromatic_adaptation_matrix_VonKries(
    colour.xy_to_XYZ(colour.RGB_COLOURSPACES['ACES2065-1'].whitepoint),
    colour.xy_to_XYZ(colour.RGB_COLOURSPACES['sRGB'].whitepoint))
print(np.dot(colour.RGB_COLOURSPACES['sRGB'].XYZ_to_RGB_matrix,
             np.dot(cat,
                    colour.RGB_COLOURSPACES['ACES2065-1'].RGB_to_XYZ_matrix)))

print('\n')

RGB = [0.35521588, 0.41, 0.24177934]
message_box(('Converting from "sRGB" colourspace to "ProPhoto RGB" '
             'colourspace given "RGB" values:\n'
             '\n\t{0}'.format(RGB)))
print(colour.RGB_to_RGB(RGB,
                        colour.RGB_COLOURSPACES['sRGB'],
                        colour.RGB_COLOURSPACES['ProPhoto RGB']))
Esempio n. 5
0
print('\nPrimaries:\n{0}'.format(colourspace.primaries))
print(('\nNormalised primary matrix to "CIE XYZ" '
       'tristimulus values:\n{0}').format(colourspace.RGB_to_XYZ_matrix))
print('\nNormalised primary matrix to "ACES2065-1":\n{0}'.format(
    colourspace.XYZ_to_RGB_matrix))
print('\nOpto-electronic transfer function from '
      'linear to colourspace:\n{0}'.format(colourspace.encoding_cctf))
print('\nElectro-optical transfer function from '
      'colourspace to linear:\n{0}'.format(colourspace.decoding_cctf))

print('\n')

message_box(('Computing "ACES2065-1" colourspace to "Rec. 709" colourspace '
             'matrix.'))
cat = colour.chromatic_adaptation_matrix_VonKries(
    colour.xy_to_XYZ(colour.RGB_COLOURSPACES['ACES2065-1'].whitepoint),
    colour.xy_to_XYZ(colour.RGB_COLOURSPACES['Rec. 709'].whitepoint))
print(
    np.dot(
        colour.RGB_COLOURSPACES['Rec. 709'].XYZ_to_RGB_matrix,
        np.dot(cat, colour.RGB_COLOURSPACES['ACES2065-1'].RGB_to_XYZ_matrix)))

print('\n')

RGB = (0.35521588, 0.41000000, 0.24177934)
message_box(('Converting from "Rec. 709" colourspace to "ACEScg" colourspace '
             'given "RGB" values:\n'
             '\n\t{0}'.format(RGB)))
print(
    colour.RGB_to_RGB(RGB, colour.RGB_COLOURSPACES['Rec. 709'],
                      colour.RGB_COLOURSPACES['ACEScg']))