pdft.color.ColorSpace#

class pdft.color.ColorSpace(matrix)[source]#

Bases: object

An invertible change of channels, applied pixel by pixel.

matrix is (C, C): row i gives channel i of the space as a combination of the image’s channels. to_planes takes an image (..., H, W, C) to its planes (..., C, H, W), in the precision the image has (integers become float64); to_image is its inverse.

Parameters:

matrix (ndarray)

__init__(matrix)#
Parameters:

matrix (ndarray)

Return type:

None

Methods

__init__(matrix)

to_image(planes)

(..., C, H, W) planes of this space -> (..., H, W, C) image.

to_planes(image)

(..., H, W, C) image -> (..., C, H, W) planes of this space.

Attributes

matrix: ndarray#
inverse: ndarray#
property channels: int#
to_planes(image)[source]#

(..., H, W, C) image -> (..., C, H, W) planes of this space.

Parameters:

image (Array)

Return type:

Array

to_image(planes)[source]#

(..., C, H, W) planes of this space -> (..., H, W, C) image.

Parameters:

planes (Array)

Return type:

Array