Exemple #1
0
    [
        (colorio.CIELAB(), False),
        # (colorio.XYY(), True),
        (colorio.CAM02("UCS", 0.69, 20, 64 / numpy.pi / 5), False),
    ],
)
def test_srgb_gamut(colorspace, cut_000, n=10):
    colorspace.save_srgb_gamut("srgb.vtu", n=n, cut_000=cut_000)
    return


@pytest.mark.parametrize(
    "colorspace",
    [
        colorio.CIELAB(),
        colorio.XYY(),
        colorio.CAM02("UCS", 0.69, 20, 64 / numpy.pi / 5),
    ],
)
def test_cone_gamut(colorspace, n=10):
    observer = colorio.observers.cie_1931_2()
    colorspace.save_cone_gamut("cone.vtu", observer, max_Y=1)
    return


@pytest.mark.parametrize(
    "colorspace",
    [colorio.CIELAB(),
     colorio.CAM02("UCS", 0.69, 20, 64 / numpy.pi / 5)])
def test_hdr_gamut(colorspace, n=10):
    colorspace.save_hdr_gamut("hdr.vtu", n=n)
import pytest

import colorio


@pytest.mark.parametrize(
    "cs,k0,level",
    [
        [colorio.XYY(), 2, 0.4],
        [colorio.CIELAB(), 0, 50],
        [colorio.CAM16UCS(0.69, 20, 4.074), 0, 50],
    ],
)
def test_visible_slice(cs, k0, level):
    cs.show_visible_slice(k0, level)
    # cs.save_visible_slice("visible-slice.png", k0, level)
    return


@pytest.mark.parametrize(
    "cs,k0,level",
    [[colorio.XYY(), 2, 0.4], [colorio.CIELUV(), 0, 50],
     [colorio.JzAzBz(), 0, 0.5]],
)
def test_macadam(cs, k0, level):
    cs.show_macadam(k0, level)
    cs.save_macadam("macadam.png", k0, level)
    return


@pytest.mark.parametrize(
Exemple #3
0
# -*- coding: utf-8 -*-
#
import numpy
import pytest

import colorio


@pytest.mark.parametrize(
    'colorspace, cut_000',
    [
        # colorio.CIELAB(),
        (colorio.XYY(), True),
        (colorio.CAM02('UCS', 0.69, 20, 64 / numpy.pi / 5), False),
    ])
def test_srgb_gamut(colorspace, cut_000, n=10):
    colorio.show_srgb_gamut(colorspace, 'srgb.vtu', n=n, cut_000=cut_000)
    return


@pytest.mark.parametrize('colorspace', [
    colorio.CIELAB(),
    colorio.CAM02('UCS', 0.69, 20, 64 / numpy.pi / 5),
])
def test_hdr_gamut(colorspace, n=10):
    colorio.show_hdr_gamut(colorspace, 'hdr.vtu', n=n)
    return


@pytest.mark.parametrize(
    'colorspace,cut_000',
Exemple #4
0
def test_conversion(xyz):
    xyy = colorio.XYY()
    out = xyy.to_xyz100(xyy.from_xyz100(xyz))
    assert numpy.all(abs(xyz - out) < 1.0e-14)
    return