예제 #1
0
def test_reference_xyz(xyz, ref):
    cs = colorio.CIELCH()
    xyz = numpy.array(xyz)
    ref = numpy.array(ref)
    assert numpy.all(abs(cs.from_xyz100(xyz) - ref) < 1.0e-4 * ref)
    return
예제 #2
0
def test_reference_xyz_d50(vals, ref):
    cs = colorio.CIELCH(whitepoint=numpy.array([96.422, 100, 82.521]) / 100)
    xyz = numpy.array(vals) / 100
    assert numpy.all(
        abs(cs.from_xyz100(xyz) - ref) < 1.0e-6 * abs(numpy.array(ref)))
    return
예제 #3
0
def test_conversion(xyz):
    cielch = colorio.CIELCH()
    out = cielch.to_xyz100(cielch.from_xyz100(xyz))
    assert numpy.all(abs(xyz - out) < 1.0e-14)
    return