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)


This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at artifex.com or contact Artifex Software Inc., 39 Mesa Street, Suite 108A, San Francisco CA 94129, United States for further information.

Discord logo