Defines the sRGB colourspace transfer function.
Parameters: | value (numeric or array_like) – Value. |
---|---|
Returns: | Companded value. |
Return type: | numeric or ndarray |
Bases: tuple
ColourParameter(name, RGB, x, y0, y1)
Alias for field number 1
Return self as a plain tuple. Used by copy and pickle.
Exclude the OrderedDict from pickling
Return a nicely formatted representation string
Alias for field number 0
Alias for field number 2
Alias for field number 3
Alias for field number 4
Returns a colour cycle iterator using given colour map.
Parameters: | **kwargs (**) – {‘colour_cycle_map’, ‘colour_cycle_count’} Keywords arguments such as {'colour_cycle_map': unicode (Matplotlib colormap name), 'colour_cycle_count': int} |
---|---|
Returns: | Colour cycle iterator. |
Return type: | cycle |
Sets the figure size.
Parameters: | **kwargs (**) – {‘figure_size’, } Keywords arguments such as {'figure_size': array_like (width, height), } |
---|---|
Returns: | Current figure. |
Return type: | Figure |
Sets the camera settings.
Parameters: | **kwargs (**) – {‘camera_aspect’, ‘elevation’, ‘azimuth’} Keywords arguments such as {'camera_aspect': unicode (Matplotlib axes aspect), 'elevation' : numeric, 'azimuth' : numeric} |
---|---|
Returns: | Definition success. |
Return type: | bool |
Sets the figure decorations.
Parameters: | **kwargs (**) – {‘title’, ‘x_label’, ‘y_label’, ‘legend’, ‘legend_columns’, ‘legend_location’, ‘x_ticker’, ‘y_ticker’, ‘x_ticker_locator’, ‘y_ticker_locator’, ‘grid’, ‘grid_which’, ‘grid_axis’, ‘x_axis_line’, ‘y_axis_line’, ‘aspect’, ‘no_axes3d’} Keywords arguments such as {'title': unicode (figure title), 'x_label': unicode (X axis label), 'y_label': unicode (Y axis label), 'legend': bool, 'legend_columns': int, 'legend_location': unicode (Matplotlib legend location), 'x_ticker': bool, 'y_ticker': bool, 'x_ticker_locator': Locator, 'y_ticker_locator': Locator, 'grid': bool, 'grid_which': unicode, 'grid_axis': unicode, 'x_axis_line': bool, 'y_axis_line': bool, 'aspect': unicode (Matplotlib axes aspect), 'no_axes3d': bool} |
---|---|
Returns: | Definition success. |
Return type: | bool |
Sets the plot boundaries.
Parameters: | **kwargs (**) – {‘bounding_box’, ‘x_tighten’, ‘y_tighten’, ‘limits’, ‘margins’} Keywords arguments such as {'bounding_box': array_like (x min, x max, y min, y max), 'x_tighten': bool, 'y_tighten': bool, 'limits': array_like (x min, x max, y min, y max), 'limits': array_like (x min, x max, y min, y max)} |
---|---|
Returns: | Definition success. |
Return type: | bool |
Sets the figure display.
Parameters: | **kwargs (**) – {‘standalone’, ‘filename’} Keywords arguments such as {'standalone': bool (figure is shown), 'filename': unicode (figure is saved as `filename`)} |
---|---|
Returns: | Definition success. |
Return type: | bool |
Add labels above given rectangles.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Sets equal aspect ratio to given 3d axes.
Parameters: | axes (object) – Axis to set the equal aspect ratio. |
---|---|
Returns: | Definition success. |
Return type: | bool |
Returns the RGB colourspace with given name.
Parameters: | colourspace (unicode) – RGB colourspace name. |
---|---|
Returns: | RGB colourspace. |
Return type: | RGB_Colourspace |
Raises: | KeyError – If the given RGB colourspace is not found in the factory RGB colourspaces. |
Returns the colour matching functions with given name.
Parameters: | cmfs (unicode) – Colour matching functions name. |
---|---|
Returns: | Colour matching functions. |
Return type: | RGB_ColourMatchingFunctions or XYZ_ColourMatchingFunctions |
Raises: | KeyError – If the given colour matching functions is not found in the factory colour matching functions. |
Returns the illuminant with given name.
Parameters: | illuminant (unicode) – Illuminant name. |
---|---|
Returns: | Illuminant. |
Return type: | SpectralPowerDistribution |
Raises: | KeyError – If the given illuminant is not found in the factory illuminants. |
Defines a factory for colour.plotting.plots.COLOUR_PARAMETER attribute.
Parameters: |
|
---|---|
Returns: | ColourParameter. |
Return type: | ColourParameter |
Plots given colour colour_parameters.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> cp1 = colour_parameter(
... x=390, RGB=[0.03009021, 0, 0.12300545])
>>> cp2 = colour_parameter(
... x=391, RGB=[0.03434063, 0, 0.13328537], y0=0, y1=0.25)
>>> cp3 = colour_parameter(
... x=392, RGB=[0.03826312, 0, 0.14276247], y0=0, y1=0.35)
>>> cp4 = colour_parameter(
... x=393, RGB=[0.04191844, 0, 0.15158707], y0=0, y1=0.05)
>>> cp5 = colour_parameter(
... x=394, RGB=[0.04535085, 0, 0.15986838], y0=0, y1=-.25)
>>> colour_parameters_plot(
... [cp1, cp2, cp3, cp3, cp4, cp5])
True
Plots given colour.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> RGB = (0.32315746, 0.32983556, 0.33640183)
>>> single_colour_plot(colour_parameter(RGB))
True
Plots given colours.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> cp1 = colour_parameter(RGB=(0.45293517, 0.31732158, 0.26414773))
>>> cp2 = colour_parameter(RGB=(0.77875824, 0.57726450, 0.50453169))
>>> multi_colour_plot([cp1, cp2])
True
Plots given image.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> import os
>>> from colour import read_image
>>> path = os.path.join(
... 'resources',
... ('CIE_1931_Chromaticity_Diagram'
... '_CIE_1931_2_Degree_Standard_Observer.png'))
>>> image = read_image(path)
>>> image_plot(image)
True
Plots given spectral power distribution.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import SpectralPowerDistribution
>>> data = {400: 0.0641, 420: 0.0645, 440: 0.0562}
>>> spd = SpectralPowerDistribution('Custom', data)
>>> single_spd_plot(spd)
True
Plots given spectral power distributions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import SpectralPowerDistribution
>>> data1 = {400: 0.0641, 420: 0.0645, 440: 0.0562}
>>> data2 = {400: 0.134, 420: 0.789, 440: 1.289}
>>> spd1 = SpectralPowerDistribution('Custom1', data1)
>>> spd2 = SpectralPowerDistribution('Custom2', data2)
>>> multi_spd_plot([spd1, spd2])
True
Plots given colour matching functions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> single_cmfs_plot()
True
Plots given colour matching functions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> cmfs = [
... 'CIE 1931 2 Degree Standard Observer',
... 'CIE 1964 10 Degree Standard Observer']
>>> multi_cmfs_plot(cmfs)
True
Plots given single illuminant relative spectral power distribution.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> single_illuminant_relative_spd_plot()
True
Plots given illuminants relative spectral power distributions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> multi_illuminants_relative_spd_plot(['A', 'B', 'C'])
True
Plots the visible colours spectrum using given standard observer CIE XYZ colour matching functions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> visible_spectrum_plot()
True
Plots given Lightness function.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> single_lightness_function_plot()
True
Plots given Lightness functions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Raises: | KeyError – If one of the given Lightness function is not found in the factory Lightness functions. |
Examples
>>> fs = ('CIE 1976', 'Wyszecki 1963')
>>> multi_lightness_function_plot(fs)
True
Plots given blackbody spectral radiance.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> blackbody_spectral_radiance_plot()
True
Plots blackbody colours.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> blackbody_colours_plot()
True
Plots given colour checker.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Raises: | KeyError – If the given colour rendition chart is not found in the factory colour rendition charts. |
Examples
>>> colour_checker_plot()
True
Plots the CIE 1931 Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> CIE_1931_chromaticity_diagram_plot()
True
Plots the CIE 1960 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> CIE_1960_UCS_chromaticity_diagram_plot()
True
Plots the CIE 1976 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> CIE_1976_UCS_chromaticity_diagram_plot()
True
Plots given spectral power distribution chromaticity coordinates into the CIE 1931 Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> A = ILLUMINANTS_RELATIVE_SPDS['A']
>>> D65 = ILLUMINANTS_RELATIVE_SPDS['D65']
>>> spds_CIE_1931_chromaticity_diagram_plot([A, D65])
True
Plots given spectral power distribution chromaticity coordinates into the CIE 1960 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> A = ILLUMINANTS_RELATIVE_SPDS['A']
>>> D65 = ILLUMINANTS_RELATIVE_SPDS['D65']
>>> spds_CIE_1960_UCS_chromaticity_diagram_plot([A, D65])
True
Plots given spectral power distribution chromaticity coordinates into the CIE 1976 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> A = ILLUMINANTS_RELATIVE_SPDS['A']
>>> D65 = ILLUMINANTS_RELATIVE_SPDS['D65']
>>> spds_CIE_1976_UCS_chromaticity_diagram_plot([A, D65])
True
Plots given chromatic adaptation model corresponding chromaticities prediction.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> corresponding_chromaticities_prediction_plot()
True
Returns the vertices of a quad geometric element in counter-clockwise order.
Parameters: |
|
---|---|
Returns: | Quad vertices. |
Return type: | ndarray |
Examples
>>> quad()
array([[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[0, 1, 0]])
Returns the vertices of a grid made of quads.
Parameters: |
|
---|---|
Returns: | Grid vertices. |
Return type: | ndarray |
Examples
>>> grid(width_segments=2, height_segments=2)
array([[[ 0. , 0. , 0. ],
[ 0.5, 0. , 0. ],
[ 0.5, 0.5, 0. ],
[ 0. , 0.5, 0. ]],
[[ 0. , 0.5, 0. ],
[ 0.5, 0.5, 0. ],
[ 0.5, 1. , 0. ],
[ 0. , 1. , 0. ]],
[[ 0.5, 0. , 0. ],
[ 1. , 0. , 0. ],
[ 1. , 0.5, 0. ],
[ 0.5, 0.5, 0. ]],
[[ 0.5, 0.5, 0. ],
[ 1. , 0.5, 0. ],
[ 1. , 1. , 0. ],
[ 0.5, 1. , 0. ]]])
Returns the vertices of a cube made of grids.
Parameters: |
|
---|---|
Returns: | Cube vertices. |
Return type: | ndarray |
Examples
>>> cube()
array([[[ 0., 0., 0.],
[ 1., 0., 0.],
[ 1., 1., 0.],
[ 0., 1., 0.]],
[[ 0., 0., 1.],
[ 1., 0., 1.],
[ 1., 1., 1.],
[ 0., 1., 1.]],
[[ 0., 0., 0.],
[ 1., 0., 0.],
[ 1., 0., 1.],
[ 0., 0., 1.]],
[[ 0., 1., 0.],
[ 1., 1., 0.],
[ 1., 1., 1.],
[ 0., 1., 1.]],
[[ 0., 0., 0.],
[ 0., 1., 0.],
[ 0., 1., 1.],
[ 0., 0., 1.]],
[[ 1., 0., 0.],
[ 1., 1., 0.],
[ 1., 1., 1.],
[ 1., 0., 1.]]])
Plots given RGB colourspaces in CIE 1931 Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_CIE_1931_chromaticity_diagram_plot(
... c)
True
Plots given RGB colourspaces in CIE 1960 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_CIE_1960_UCS_chromaticity_diagram_plot(
... c)
True
Plots given RGB colourspaces in CIE 1976 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_CIE_1976_UCS_chromaticity_diagram_plot(
... c)
True
Plots given RGB colourspace array in CIE 1931 Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> RGB = np.random.random((10, 10, 3))
>>> c = 'Rec. 709'
>>> RGB_chromaticity_coordinates_CIE_1931_chromaticity_diagram_plot(
... RGB, c)
True
Plots given RGB colourspace array in CIE 1960 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> RGB = np.random.random((10, 10, 3))
>>> c = 'Rec. 709'
>>> RGB_chromaticity_coordinates_CIE_1960_UCS_chromaticity_diagram_plot(
... RGB, c)
True
Plots given RGB colourspace array in CIE 1976 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> RGB = np.random.random((10, 10, 3))
>>> c = 'Rec. 709'
>>> RGB_chromaticity_coordinates_CIE_1976_UCS_chromaticity_diagram_plot(
... RGB, c)
True
Plots given colourspace transfer function.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> single_transfer_function_plot()
True
Plots given colourspaces transfer functions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> multi_transfer_function_plot(['Rec. 709', 'sRGB'])
True
Plots given Lightness function.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> f = 'ASTM D1535-08'
>>> single_munsell_value_function_plot(f)
True
Plots given Munsell value functions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Raises: | KeyError – If one of the given Munsell value function is not found in the factory Munsell value functions. |
Examples
>>> fs = ('ASTM D1535-08', 'McCamy 1987')
>>> multi_munsell_value_function_plot(fs)
True
Plots a single rayleigh scattering spectral power distribution.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> single_rayleigh_scattering_spd_plot()
True
Plots the blue sky.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> the_blue_sky_plot()
True
Plots the colour rendering index of given illuminant or light source spectral power distribution.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> single_spd_colour_rendering_index_bars_plot(
... illuminant)
True
Plots the colour rendering index of given illuminants or light sources spectral power distributions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import (
... ILLUMINANTS_RELATIVE_SPDS,
... LIGHT_SOURCES_RELATIVE_SPDS)
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> light_source = LIGHT_SOURCES_RELATIVE_SPDS.get('Kinoton 75P')
>>> multi_spd_colour_rendering_index_bars_plot(
... [illuminant, light_source])
True
Plots the colour quality scale of given illuminant or light source spectral power distribution.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import ILLUMINANTS_RELATIVE_SPDS
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> single_spd_colour_quality_scale_bars_plot(
... illuminant)
True
Plots the colour quality scale of given illuminants or light sources spectral power distributions.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> from colour import (
... ILLUMINANTS_RELATIVE_SPDS,
... LIGHT_SOURCES_RELATIVE_SPDS)
>>> illuminant = ILLUMINANTS_RELATIVE_SPDS.get('F2')
>>> light_source = LIGHT_SOURCES_RELATIVE_SPDS.get('Kinoton 75P')
>>> multi_spd_colour_quality_scale_bars_plot(
... [illuminant, light_source])
True
Plots the planckian locus and given illuminants in CIE 1931 Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Raises: | KeyError – If one of the given illuminant is not found in the factory illuminants. |
Examples
>>> ils = ['A', 'B', 'C']
>>> planckian_locus_CIE_1931_chromaticity_diagram_plot(
... ils)
True
Plots the planckian locus and given illuminants in CIE 1960 UCS Chromaticity Diagram.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Raises: | KeyError – If one of the given illuminant is not found in the factory illuminants. |
Examples
>>> ils = ['A', 'C', 'E']
>>> planckian_locus_CIE_1960_UCS_chromaticity_diagram_plot(
... ils)
True
Plots given RGB colourspaces gamuts in given reference colourspace.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> c = ['Rec. 709', 'ACEScg', 'S-Gamut']
>>> RGB_colourspaces_gamuts_plot(c)
True
Plots given RGB colourspace array in a scatter plot.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Examples
>>> c = 'Rec. 709'
>>> RGB_scatter_plot(c)
True