Colorspace

Represents the color space of a Pixmap.

Class API

class Colorspace
__init__(self, n)

Constructor

Parameters:n (int) – A number identifying the colorspace. Possible values are CS_RGB, CS_GRAY and CS_CMYK.
name

The name identifying the colorspace. Example: fitz.csCMYK.name = 'DeviceCMYK'.

Type:str
n

The number of bytes required to define the color of one pixel. Example: fitz.csCMYK.n == 4.

type:int

Predefined Colorspaces

For saving some typing effort, there exist predefined colorspace objects for the three available cases.

  • csRGB = fitz.Colorspace(fitz.CS_RGB)
  • csGRAY = fitz.Colorspace(fitz.CS_GRAY)
  • csCMYK = fitz.Colorspace(fitz.CS_CMYK)