Enums

Details

class Vips.Access(value)

Bases: GObject.GEnum

The type of access an operation has to supply. See [method`Image`.tilecache] and [class`Foreign`].

[enum`Vips`.Access.RANDOM] means requests can come in any order.

[enum`Vips`.Access.SEQUENTIAL] means requests will be top-to-bottom, but with some amount of buffering behind the read point for small non-local accesses.

RANDOM = 0

can read anywhere

SEQUENTIAL = 1

top-to-bottom reading only, but with a small buffer

SEQUENTIAL_UNBUFFERED = 2

deprecated, use [enum`Vips`.Access.SEQUENTIAL] instead

class Vips.Align(value)

Bases: GObject.GEnum

See [method`Image`.join] and so on.

Operations like [method`Image`.join] need to be told whether to align images on the low or high coordinate edge, or centre.

::: seealso [method`Image`.join].

LOW = 0

align low coordinate edge

CENTRE = 1

align centre

HIGH = 2

align high coordinate edge

class Vips.Angle(value)

Bases: GObject.GEnum

See [method`Image`.rot] and so on.

Fixed rotate angles.

::: seealso [method`Image`.rot].

D0 = 0

no rotate

D90 = 1

90 degrees clockwise

D180 = 2

180 degree rotate

D270 = 3

90 degrees anti-clockwise

class Vips.Angle45(value)

Bases: GObject.GEnum

See [method`Image`.rot45] and so on.

Fixed rotate angles.

::: seealso [method`Image`.rot45].

D0 = 0

no rotate

D45 = 1

45 degrees clockwise

D90 = 2

90 degrees clockwise

D135 = 3

135 degrees clockwise

D180 = 4

180 degrees

D225 = 5

135 degrees anti-clockwise

D270 = 6

90 degrees anti-clockwise

D315 = 7

45 degrees anti-clockwise

class Vips.BandFormat(value)

Bases: GObject.GEnum

The format used for each band element.

Each corresponds to a native C type for the current machine. For example, [enum`Vips`.BandFormat.USHORT] is unsigned short.

classmethod is8bit(format)
Parameters:

format (Vips.BandFormat) – format to test

Return type:

bool

Return TRUE if format is uchar or schar.

classmethod iscomplex(format)
Parameters:

format (Vips.BandFormat) – format to test

Return type:

bool

Return TRUE if fmt is one of the complex types.

classmethod isfloat(format)
Parameters:

format (Vips.BandFormat) – format to test

Return type:

bool

Return TRUE if format is one of the float types.

classmethod isint(format)
Parameters:

format (Vips.BandFormat) – format to test

Return type:

bool

Return TRUE if format is one of the integer types.

classmethod isuint(format)
Parameters:

format (Vips.BandFormat) – format to test

Return type:

bool

Return TRUE if format is one of the unsigned integer types.

NOTSET = -1

invalid setting

UCHAR = 0

unsigned str format

CHAR = 1

str format

USHORT = 2

unsigned short format

SHORT = 3

short format

UINT = 4

unsigned int format

INT = 5

int format

FLOAT = 6

float format

COMPLEX = 7

complex (two floats) format

DOUBLE = 8

double float format

DPCOMPLEX = 9

double complex (two double) format

class Vips.BlendMode(value)

Bases: GObject.GEnum

The various Porter-Duff and PDF blend modes. See [func`Image`.composite], for example.

The Cairo docs have a nice explanation of all the blend modes.

The non-separable modes are not implemented.

CLEAR = 0

where the second object is drawn, the first is removed

SOURCE = 1

the second object is drawn as if nothing were below

DEST_ATOP = 10

like ATOP, but swaps the arguments

XOR = 11

something like a difference operator

ADD = 12

a bit like adding the two images

SATURATE = 13

a bit like the darker of the two

MULTIPLY = 14

at least as dark as the darker of the two inputs

SCREEN = 15

at least as light as the lighter of the inputs

OVERLAY = 16

multiplies or screens colors, depending on the lightness

DARKEN = 17

the darker of each component

LIGHTEN = 18

the lighter of each component

COLOUR_DODGE = 19

brighten first by a factor second

OVER = 2

the image shows what you would expect if you held two semi-transparent slides on top of each other

COLOUR_BURN = 20

darken first by a factor of second

HARD_LIGHT = 21

multiply or screen, depending on lightness

SOFT_LIGHT = 22

darken or lighten, depending on lightness

DIFFERENCE = 23

difference of the two

EXCLUSION = 24

somewhat like DIFFERENCE, but lower-contrast

IN = 3

the first object is removed completely, the second is only drawn where the first was

OUT = 4

the second is drawn only where the first isn’t

ATOP = 5

this leaves the first object mostly intact, but mixes both objects in the overlapping area

DEST = 6

leaves the first object untouched, the second is discarded completely

DEST_OVER = 7

like OVER, but swaps the arguments

DEST_IN = 8

like IN, but swaps the arguments

DEST_OUT = 9

like OUT, but swaps the arguments

class Vips.Coding(value)

Bases: GObject.GEnum

How pixels are coded.

Normally, pixels are uncoded and can be manipulated as you would expect. However some file formats code pixels for compression, and sometimes it’s useful to be able to manipulate images in the coded format.

The gaps in the numbering are historical and must be maintained. Allocate new numbers from the end.

ERROR = -1
NONE = 0

pixels are not coded

LABQ = 2

pixels encode 3 float CIELAB values as 4 uchar

RAD = 6

pixels encode 3 float RGB as 4 uchar (Radiance coding)

class Vips.Combine(value)

Bases: GObject.GEnum

How to combine values. See [method`Image`.compass], for example.

MAX = 0

take the maximum of the possible values

SUM = 1

sum all the values

MIN = 2

take the minimum value

class Vips.CombineMode(value)

Bases: GObject.GEnum

See [method`Image`.draw_image] and so on.

Operations like [method`Image`.draw_image] need to be told how to combine images from two sources.

::: seealso [method`Image`.join].

SET = 0

set pixels to the new value

ADD = 1

add pixels

class Vips.CompassDirection(value)

Bases: GObject.GEnum

A direction on a compass. Used for [method`Image`.gravity], for example.

CENTRE = 0

centre

NORTH = 1

north

EAST = 2

east

SOUTH = 3

south

WEST = 4

west

NORTH_EAST = 5

north-east

SOUTH_EAST = 6

south-east

SOUTH_WEST = 7

south-west

NORTH_WEST = 8

north-west

class Vips.DemandStyle(value)

Bases: GObject.GEnum

See [method`Image`.pipelinev]. Operations can hint the kind of demand geometry they prefer to the VIPS image IO system.

These demand styles are given below in order of increasing specialisation. When demanding output from a pipeline, [method`Image`.generate] will use the most general style requested by the operations in the pipeline.

[enum`Vips`.DemandStyle.SMALLTILE] – This is the most general demand format. Output is demanded in small (around 100x100 pel) sections. This style works reasonably efficiently, even for bizarre operations like 45 degree rotate.

[enum`Vips`.DemandStyle.FATSTRIP] – This operation would like to output strips the width of the image and as high as possible. This option is suitable for area operations which do not violently transform coordinates, such as [method`Image`.conv].

[enum`Vips`.DemandStyle.THINSTRIP] – This operation would like to output strips the width of the image and a few pels high. This option is suitable for point-to-point operations, such as those in the arithmetic package.

[enum`Vips`.DemandStyle.ANY] – This image is not being demand-read from a disc file (even indirectly) so any demand style is OK. It’s used for things like [ctor`Image`.black] where the pixels are calculated.

::: seealso [method`Image`.pipelinev].

ERROR = -1
SMALLTILE = 0

demand in small (typically 128x128 pixel) tiles

FATSTRIP = 1

demand in fat (typically 16 pixel high) strips

THINSTRIP = 2

demand in thin (typically 1 pixel high) strips

ANY = 3

demand geometry does not matter

class Vips.Direction(value)

Bases: GObject.GEnum

See [method`Image`.flip], [method`Image`.join] and so on.

Operations like [method`Image`.flip] need to be told whether to flip left-right or top-bottom.

::: seealso [method`Image`.flip], [method`Image`.join].

HORIZONTAL = 0

left-right

VERTICAL = 1

top-bottom

class Vips.Extend(value)

Bases: GObject.GEnum

See [method`Image`.embed], [method`Image`.conv], [method`Image`.affine] and so on.

When the edges of an image are extended, you can specify how you want the extension done.

[enum`Vips`.Extend.BLACK] – new pixels are black, ie. all bits are zero.

[enum`Vips`.Extend.COPY] – each new pixel takes the value of the nearest edge pixel

[enum`Vips`.Extend.REPEAT] – the image is tiled to fill the new area

[enum`Vips`.Extend.MIRROR] – the image is reflected and tiled to reduce hash edges

[enum`Vips`.Extend.WHITE] – new pixels are white, ie. all bits are set

[enum`Vips`.Extend.BACKGROUND] – colour set from the background property

We have to specify the exact value of each enum member since we have to keep these frozen for back compat with vips7.

::: seealso [method`Image`.embed].

BLACK = 0

extend with black (all 0) pixels

COPY = 1

copy the image edges

REPEAT = 2

repeat the whole image

MIRROR = 3

mirror the whole image

WHITE = 4

extend with white (all bits set) pixels

BACKGROUND = 5

extend with colour from the background property

class Vips.FailOn(value)

Bases: GObject.GEnum

How sensitive loaders are to errors, from never stop (very insensitive), to stop on the smallest warning (very sensitive).

Each one implies the ones before it, so [enum`Vips`.FailOn.ERROR] implies [enum`Vips`.FailOn.TRUNCATED].

NONE = 0

never stop

TRUNCATED = 1

stop on image truncated, nothing else

ERROR = 2

stop on serious error or truncation

WARNING = 3

stop on anything, even warnings

class Vips.ForeignDzContainer(value)

Bases: GObject.GEnum

What container format to use.

FS = 0

write tiles to the filesystem

ZIP = 1

write tiles to a zip file

SZI = 2

write to a szi file

class Vips.ForeignDzDepth(value)

Bases: GObject.GEnum

How many pyramid layers to create.

ONEPIXEL = 0

create layers down to 1x1 pixel

ONETILE = 1

create layers down to 1x1 tile

ONE = 2

only create a single layer

class Vips.ForeignDzLayout(value)

Bases: GObject.GEnum

What directory layout and metadata standard to use.

DZ = 0

use DeepZoom directory layout

ZOOMIFY = 1

use Zoomify directory layout

GOOGLE = 2

use Google maps directory layout

IIIF = 3

use IIIF v2 directory layout

IIIF3 = 4

use IIIF v3 directory layout

class Vips.ForeignHeifCompression(value)

Bases: GObject.GEnum

The compression format to use inside a HEIF container.

This is assumed to use the same numbering as heif_compression_format.

HEVC = 1

x265

AVC = 2

x264

JPEG = 3

jpeg

AV1 = 4

aom

class Vips.ForeignHeifEncoder(value)

Bases: GObject.GEnum

The selected encoder to use. If libheif hasn’t been compiled with the selected encoder, we will fallback to the default encoder for the compression format.

AUTO = 0

auto

AOM = 1

aom

RAV1E = 2

RAV1E

SVT = 3

SVT-AV1

X265 = 4

x265

class Vips.ForeignJpegSubsample(value)

Bases: GObject.GEnum

AUTO = 0
ON = 1
OFF = 2
class Vips.ForeignPdfPageBox(value)

Bases: GObject.GEnum

Each page of a PDF document can contain multiple page boxes, also known as boundary boxes or print marks.

Each page box defines a region of the complete page that should be rendered. The default region is the crop box.

MEDIA = 0

media box

CROP = 1

crop box

TRIM = 2

trim box

BLEED = 3

bleed box

ART = 4

art box

class Vips.ForeignPpmFormat(value)

Bases: GObject.GEnum

The netpbm file format to save as.

[enum`Vips`.ForeignPpmFormat.PBM] images are single bit.

[enum`Vips`.ForeignPpmFormat.PGM] images are 8, 16, or 32-bits, one band.

[enum`Vips`.ForeignPpmFormat.PPM] images are 8, 16, or 32-bits, three bands.

[enum`Vips`.ForeignPpmFormat.PFM] images are 32-bit float pixels.

[enum`Vips`.ForeignPpmFormat.PNM] images are anymap images – the image format is used to pick the saver.

PBM = 0

portable bitmap

PGM = 1

portable greymap

PPM = 2

portable pixmap

PFM = 3

portable float map

PNM = 4

portable anymap

class Vips.ForeignSubsample(value)

Bases: GObject.GEnum

Set subsampling mode.

AUTO = 0

prevent subsampling when quality >= 90

ON = 1

always perform subsampling

OFF = 2

never perform subsampling

class Vips.ForeignTiffCompression(value)

Bases: GObject.GEnum

The compression types supported by the tiff writer.

Use Q to set the jpeg compression level, default 75.

Use predictor to set the lzw or deflate prediction, default horizontal.

Use lossless to set WEBP lossless compression.

Use level to set webp and zstd compression level.

NONE = 0

no compression

JPEG = 1

jpeg compression

DEFLATE = 2

deflate (zip) compression

PACKBITS = 3

packbits compression

CCITTFAX4 = 4

fax4 compression

LZW = 5

LZW compression

WEBP = 6

WEBP compression

ZSTD = 7

ZSTD compression

JP2K = 8

JP2K compression

class Vips.ForeignTiffPredictor(value)

Bases: GObject.GEnum

The predictor can help deflate and lzw compression. The values are fixed by the tiff library.

NONE = 1

no prediction

HORIZONTAL = 2

horizontal differencing

FLOAT = 3

float predictor

class Vips.ForeignTiffResunit(value)

Bases: GObject.GEnum

Use inches or centimeters as the resolution unit for a tiff file.

CM = 0

use centimeters

INCH = 1

use inches

class Vips.ForeignWebpPreset(value)

Bases: GObject.GEnum

Tune lossy encoder settings for different image types.

DEFAULT = 0

default preset

PICTURE = 1

digital picture, like portrait, inner shot

PHOTO = 2

outdoor photograph, with natural lighting

DRAWING = 3

hand or line drawing, with high-contrast details

ICON = 4

small-sized colorful images

TEXT = 5

text-like

class Vips.ImageType(value)

Bases: GObject.GEnum

ERROR = -1
NONE = 0
SETBUF = 1
SETBUF_FOREIGN = 2
OPENIN = 3
MMAPIN = 4
MMAPINRW = 5
OPENOUT = 6
PARTIAL = 7
class Vips.Intent(value)

Bases: GObject.GEnum

The rendering intent. [enum`Vips`.Intent.ABSOLUTE] is best for scientific work, [enum`Vips`.Intent.RELATIVE] is usually best for accurate communication with other imaging libraries.

PERCEPTUAL = 0

perceptual rendering intent

RELATIVE = 1

relative colorimetric rendering intent

SATURATION = 2

saturation rendering intent

ABSOLUTE = 3

absolute colorimetric rendering intent

AUTO = 32

the rendering intent that the profile suggests

class Vips.Interesting(value)

Bases: GObject.GEnum

Pick the algorithm vips uses to decide image “interestingness”. This is used by [method`Image`.smartcrop], for example, to decide what parts of the image to keep.

[enum`Vips`.Interesting.NONE] and [enum`Vips`.Interesting.LOW] mean the same – the crop is positioned at the top or left. [enum`Vips`.Interesting.HIGH] positions at the bottom or right.

::: seealso [method`Image`.smartcrop].

NONE = 0

do nothing

CENTRE = 1

just take the centre

ENTROPY = 2

use an entropy measure

ATTENTION = 3

look for features likely to draw human attention

LOW = 4

position the crop towards the low coordinate

HIGH = 5

position the crop towards the high coordinate

ALL = 6

everything is interesting

class Vips.Interpretation(value)

Bases: GObject.GEnum

How the values in an image should be interpreted. For example, a three-band float image of type [enum`Vips`.Interpretation.LAB] should have its pixels interpreted as coordinates in CIE Lab space.

RGB and sRGB are treated in the same way. Use the colourspace functions if you want some other behaviour.

The gaps in numbering are historical and must be maintained. Allocate new numbers from the end.

classmethod bands(interpretation)
Parameters:

interpretation (Vips.Interpretation) – image to check

Returns:

the number of bands implied by this interpretation, or 0.

Return type:

int

The number of “real” bands we expect for this interpretation. If we’ve no idea (eg. MULTIBAND), return 0.

classmethod max_alpha(interpretation)
Parameters:

interpretation (Vips.Interpretation) – image interpretation

Returns:

the maximum alpha value for an interpretation.

Return type:

float

ERROR = -1
MULTIBAND = 0

generic many-band image

B_W = 1

some kind of single-band image

HISTOGRAM = 10

a 1D image, eg. histogram or lookup table

XYZ = 12

the first three bands are CIE XYZ

LAB = 13

pixels are in CIE Lab space

CMYK = 15

the first four bands are in CMYK space

LABQ = 16

implies [enum`Vips`.Coding.LABQ]

RGB = 17

generic RGB space

CMC = 18

a uniform colourspace based on CMC(1:1)

LCH = 19

pixels are in CIE LCh space

LABS = 21

CIE LAB coded as three signed 16-bit values

SRGB = 22

pixels are sRGB

YXY = 23

pixels are CIE Yxy

FOURIER = 24

image is in fourier space

RGB16 = 25

generic 16-bit RGB

GREY16 = 26

generic 16-bit mono

MATRIX = 27

a matrix

SCRGB = 28

pixels are scRGB

HSV = 29

pixels are HSV

OKLAB = 30

pixels are in Oklab colourspace

OKLCH = 31

pixels are in Oklch colourspace

class Vips.Kernel(value)

Bases: GObject.GEnum

The resampling kernels vips supports. See [method`Image`.reduce], for example.

NEAREST = 0

the nearest pixel to the point

LINEAR = 1

convolve with a triangle filter

CUBIC = 2

convolve with a cubic filter

MITCHELL = 3

convolve with a Mitchell kernel

LANCZOS2 = 4

convolve with a two-lobe Lanczos kernel

LANCZOS3 = 5

convolve with a three-lobe Lanczos kernel

MKS2013 = 6

convolve with Magic Kernel Sharp 2013

MKS2021 = 7

convolve with Magic Kernel Sharp 2021

class Vips.OperationBoolean(value)

Bases: GObject.GEnum

See also: [method`Image`.boolean].

AND = 0

&

OR = 1

|

EOR = 2

^

LSHIFT = 3

>>

RSHIFT = 4

<<

class Vips.OperationComplex(value)

Bases: GObject.GEnum

See also: [method`Image`.complex].

POLAR = 0

convert to polar coordinates

RECT = 1

convert to rectangular coordinates

CONJ = 2

complex conjugate

class Vips.OperationComplex2(value)

Bases: GObject.GEnum

See also: [method`Image`.complex2].

CROSS_PHASE = 0

convert to polar coordinates

class Vips.OperationComplexget(value)

Bases: GObject.GEnum

See also: [method`Image`.complexget].

REAL = 0

get real component

IMAG = 1

get imaginary component

class Vips.OperationMath(value)

Bases: GObject.GEnum

See also: [method`Image`.math].

SIN = 0

sin(), angles in degrees

COS = 1

cos(), angles in degrees

SINH = 10

sinh(), angles in radians

COSH = 11

cosh(), angles in radians

TANH = 12

tanh(), angles in radians

ASINH = 13

asinh(), angles in radians

ACOSH = 14

acosh(), angles in radians

ATANH = 15

atanh(), angles in radians

TAN = 2

tan(), angles in degrees

ASIN = 3

asin(), angles in degrees

ACOS = 4

acos(), angles in degrees

ATAN = 5

atan(), angles in degrees

LOG = 6

log base e

LOG10 = 7

log base 10

EXP = 8

e to the something

EXP10 = 9

10 to the something

class Vips.OperationMath2(value)

Bases: GObject.GEnum

See also: [method`Image`.math].

POW = 0

pow(left, right)

WOP = 1

pow(right, left)

ATAN2 = 2

atan2(left, right)

class Vips.OperationMorphology(value)

Bases: GObject.GEnum

More like hit-miss, really.

::: seealso [method`Image`.morph].

ERODE = 0

true if all set

DILATE = 1

true if one set

class Vips.OperationRelational(value)

Bases: GObject.GEnum

See also: [method`Image`.relational].

EQUAL = 0

==

NOTEQ = 1

!=

LESS = 2

<

LESSEQ = 3

<=

MORE = 4

>

MOREEQ = 5

>=

class Vips.OperationRound(value)

Bases: GObject.GEnum

See also: [method`Image`.round].

RINT = 0

round to nearest

CEIL = 1

the smallest integral value not less than

FLOOR = 2

largest integral value not greater than

class Vips.PCS(value)

Bases: GObject.GEnum

Pick a Profile Connection Space for [method`Image`.icc_import] and [method`Image`.icc_export]. LAB is usually best, XYZ can be more convenient in some cases.

LAB = 0

use CIELAB D65 as the Profile Connection Space

XYZ = 1

use XYZ as the Profile Connection Space

class Vips.Precision(value)

Bases: GObject.GEnum

How accurate an operation should be.

INTEGER = 0

int everywhere

FLOAT = 1

float everywhere

APPROXIMATE = 2

approximate integer output

class Vips.RegionShrink(value)

Bases: GObject.GEnum

How to calculate the output pixels when shrinking a 2x2 region.

Images with alpha (see [method`Image`.hasalpha]) always shrink with [enum`Vips`.RegionShrink.MEAN] and pixels scaled by alpha to avoid fringing.

Set the image interpretation to [enum`Vips`.Interpretation.MULTIBAND] to treat all bands equally.

MEAN = 0

use the average

MEDIAN = 1

use the median

MODE = 2

use the mode

MAX = 3

use the maximum

MIN = 4

use the minimum

NEAREST = 5

use the top-left pixel

class Vips.SdfShape(value)

Bases: GObject.GEnum

The SDF to generate,

::: seealso [ctor`Image`.sdf].

CIRCLE = 0

a circle at a, radius r

BOX = 1

a box from a to b

ROUNDED_BOX = 2

a box with rounded corners from a to b

LINE = 3

a line from a to b

class Vips.Size(value)

Bases: GObject.GEnum

Controls whether an operation should upsize, downsize, both up and downsize, or force a size.

::: seealso [ctor`Image`.thumbnail].

BOTH = 0

size both up and down

UP = 1

only upsize

DOWN = 2

only downsize

FORCE = 3

force size, that is, break aspect ratio

class Vips.TextWrap(value)

Bases: GObject.GEnum

Sets the word wrapping style for [ctor`Image`.text] when used with a maximum width.

::: seealso [ctor`Image`.text].

WORD = 0

wrap at word boundaries

CHAR = 1

wrap at character boundaries

WORD_CHAR = 2

wrap at word boundaries, but fall back to character boundaries if there is not enough space for a full word

NONE = 3

no wrapping