lcms2.Intent

class Intent(*values)[source]

Bases: IntEnum

ICC rendering intents plus LittleCMS’s black-preserving intents.

Strings are accepted wherever an intent is expected, case-insensitively, with the short aliases "relative" and "absolute".

Examples

>>> Intent.parse("relative")
<Intent.RELATIVE_COLORIMETRIC: 1>
>>> Intent.parse("Absolute Colorimetric")
<Intent.ABSOLUTE_COLORIMETRIC: 3>
__init__(*args, **kwds)

Methods

conjugate()

Returns self, the complex conjugate of any int.

bit_length()

Number of bits necessary to represent self in binary.

bit_count()

Number of ones in the binary representation of the absolute value of self.

to_bytes([length, byteorder, signed])

Return an array of bytes representing an integer.

from_bytes(bytes[, byteorder, signed])

Return the integer represented by the given array of bytes.

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

is_integer()

Returns True.

parse(value)

Convert an int or a name (case-insensitive, aliases allowed) to an Intent.

__init__(*args, **kwds)

Attributes

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms

PERCEPTUAL

RELATIVE_COLORIMETRIC

SATURATION

ABSOLUTE_COLORIMETRIC

PRESERVE_K_ONLY_PERCEPTUAL

PRESERVE_K_ONLY_RELATIVE_COLORIMETRIC

PRESERVE_K_ONLY_SATURATION

PRESERVE_K_PLANE_PERCEPTUAL

PRESERVE_K_PLANE_RELATIVE_COLORIMETRIC

PRESERVE_K_PLANE_SATURATION

PERCEPTUAL = 0
RELATIVE_COLORIMETRIC = 1
SATURATION = 2
ABSOLUTE_COLORIMETRIC = 3
PRESERVE_K_ONLY_PERCEPTUAL = 10
PRESERVE_K_ONLY_RELATIVE_COLORIMETRIC = 11
PRESERVE_K_ONLY_SATURATION = 12
PRESERVE_K_PLANE_PERCEPTUAL = 13
PRESERVE_K_PLANE_RELATIVE_COLORIMETRIC = 14
PRESERVE_K_PLANE_SATURATION = 15
classmethod parse(value: Intent | int | str) → Intent[source]

Convert an int or a name (case-insensitive, aliases allowed) to an Intent.

Raises:

ValueError – For unknown names or numbers, listing the valid names.