Enums¶
Vips.Access
Vips.Align
Vips.Angle
Vips.Angle45
Vips.BandFormat
Vips.BlendMode
Vips.Coding
Vips.Combine
Vips.CombineMode
Vips.CompassDirection
Vips.DemandStyle
Vips.Direction
Vips.Extend
Vips.ForeignDzContainer
Vips.ForeignDzDepth
Vips.ForeignDzLayout
Vips.ForeignHeifCompression
Vips.ForeignJpegSubsample
Vips.ForeignTiffCompression
Vips.ForeignTiffPredictor
Vips.ForeignTiffResunit
Vips.ForeignWebpPreset
Vips.ImageType
Vips.Intent
Vips.Interesting
Vips.Interpretation
Vips.Kernel
Vips.OperationBoolean
Vips.OperationComplex
Vips.OperationComplex2
Vips.OperationComplexget
Vips.OperationMath
Vips.OperationMath2
Vips.OperationMorphology
Vips.OperationRelational
Vips.OperationRound
Vips.PCS
Vips.Precision
Vips.RegionShrink
Vips.Saveable
Vips.Size
Vips.Token
Details¶
-
class
Vips.
Access
(value)¶ Bases:
GObject.GEnum
The type of access an operation has to supply. See vips_tilecache() and
Vips.Foreign
.Vips.Access.RANDOM
means requests can come in any order.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¶
-
LAST
= 3¶
-
-
class
Vips.
Align
(value)¶ Bases:
GObject.GEnum
See vips_join() and so on.
Operations like vips_join() need to be told whether to align images on the low or high coordinate edge, or centre.
See also: vips_join().
-
LOW
= 0¶ align low coordinate edge
-
CENTRE
= 1¶ align centre
-
HIGH
= 2¶ align high coordinate edge
-
LAST
= 3¶
-
-
class
Vips.
Angle
(value)¶ Bases:
GObject.GEnum
See vips_rot() and so on.
Fixed rotate angles.
See also: vips_rot().
-
D0
= 0¶ no rotate
-
D90
= 1¶ 90 degrees clockwise
-
D180
= 2¶ 180 degree rotate
-
D270
= 3¶ 90 degrees anti-clockwise
-
LAST
= 4¶
-
-
class
Vips.
Angle45
(value)¶ Bases:
GObject.GEnum
See vips_rot45() and so on.
Fixed rotate angles.
See also: vips_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
-
LAST
= 8¶
-
-
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,
Vips.BandFormat.USHORT
isunsigned short
.-
classmethod
is8bit
(format)¶ Parameters: format ( Vips.BandFormat
) – format to testReturn type: bool
Return
True
if format is uchar or schar.
-
classmethod
iscomplex
(format)¶ Parameters: format ( Vips.BandFormat
) – format to testReturn type: bool
Return
True
if fmt is one of the complex types.
-
classmethod
isfloat
(format)¶ Parameters: format ( Vips.BandFormat
) – format to testReturn type: bool
Return
True
if format is one of the float types.
-
classmethod
isint
(format)¶ Parameters: format ( Vips.BandFormat
) – format to testReturn type: bool
Return
True
if format is one of the integer types.
-
classmethod
isuint
(format)¶ Parameters: format ( Vips.BandFormat
) – format to testReturn type: bool
Return
True
if format is one of the unsigned integer types.
-
NOTSET
= -1¶ invalid setting
-
LAST
= 10¶
-
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
-
classmethod
-
class
Vips.
BlendMode
(value)¶ Bases:
GObject.GEnum
The various Porter-Duff and PDF blend modes. See vips_composite(), for example.
The Cairo docs have a nice explanation of all the blend modes:
https://www.cairographics.org/operators
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
-
LAST
= 25¶
-
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)
-
LAST
= 7¶
-
-
class
Vips.
Combine
(value)¶ Bases:
GObject.GEnum
How to combine values. See vips_compass(), for example.
-
MAX
= 0¶ take the maximum of the possible values
-
SUM
= 1¶ sum all the values
-
MIN
= 2¶ take the minimum value
-
LAST
= 3¶
-
-
class
Vips.
CombineMode
(value)¶ Bases:
GObject.GEnum
See vips_draw_image() and so on.
Operations like vips_draw_image() need to be told how to combine images from two sources.
See also: vips_join().
-
SET
= 0¶ set pixels to the new value
-
ADD
= 1¶ add pixels
-
LAST
= 2¶
-
-
class
Vips.
CompassDirection
(value)¶ Bases:
GObject.GEnum
A direction on a compass. Used for vips_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
-
LAST
= 9¶
-
-
class
Vips.
DemandStyle
(value)¶ Bases:
GObject.GEnum
See vips_image_pipelinev(). Operations can hint to the VIPS image IO system about the kind of demand geometry they prefer.
These demand styles are given below in order of increasing restrictiveness. When demanding output from a pipeline, vips_image_generate() will use the most restrictive of the styles requested by the operations in the pipeline.
Vips.DemandStyle.THINSTRIP
— This operation would like to output strips the width of the image and a few pels high. This is option suitable for point-to-point operations, such as those in the arithmetic package.This option is only efficient for cases where each output pel depends upon the pel in the corresponding position in the input image.
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 vips_conv().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 bizzare operations like 45 degree rotate.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 vips_black() where the pixels are calculated.See also: vips_image_pipelinev().
-
ERROR
= -1¶
-
SMALLTILE
= 0¶ demand in small (typically 64x64 pixel) tiles
-
FATSTRIP
= 1¶ demand in fat (typically 10 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 vips_flip(), vips_join() and so on.
Operations like vips_flip() need to be told whether to flip left-right or top-bottom.
See also: vips_flip(), vips_join().
-
HORIZONTAL
= 0¶ left-right
-
VERTICAL
= 1¶ top-bottom
-
LAST
= 2¶
-
-
class
Vips.
Extend
(value)¶ Bases:
GObject.GEnum
See vips_embed(), vips_conv(), vips_affine() and so on.
When the edges of an image are extended, you can specify how you want the extension done.
Vips.Extend.BLACK
— new pixels are black, ie. all bits are zero.Vips.Extend.COPY
— each new pixel takes the value of the nearest edge pixelVips.Extend.REPEAT
— the image is tiled to fill the new areaVips.Extend.MIRROR
— the image is reflected and tiled to reduce hash edgesVips.Extend.WHITE
— new pixels are white, ie. all bits are setVips.Extend.BACKGROUND
— colour set from the background propertyWe have to specify the exact value of each enum member since we have to keep these frozen for back compat with vips7.
See also: vips_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
-
LAST
= 6¶
-
-
class
Vips.
ForeignDzContainer
(value)¶ Bases:
GObject.GEnum
How many pyramid layers to create.
-
FS
= 0¶ write tiles to the filesystem
-
ZIP
= 1¶ write tiles to a zip file
-
SZI
= 2¶ write to a szi file
-
LAST
= 3¶
-
-
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
-
LAST
= 3¶
-
-
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 directory layout
-
LAST
= 4¶
-
-
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
-
LAST
= 5¶
-
-
class
Vips.
ForeignJpegSubsample
(value)¶ Bases:
GObject.GEnum
Set jpeg subsampling mode.
-
AUTO
= 0¶ default preset
-
ON
= 1¶ always perform subsampling
-
OFF
= 2¶ never perform subsampling
-
LAST
= 3¶
-
-
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
-
LAST
= 8¶
-
-
class
Vips.
ForeignTiffPredictor
(value)¶ Bases:
GObject.GEnum
-
NONE
= 1¶
-
HORIZONTAL
= 2¶
-
FLOAT
= 3¶
-
LAST
= 4¶
-
-
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
-
LAST
= 2¶
-
-
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
-
LAST
= 6¶
-
-
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.
Vips.Intent.ABSOLUTE
is best for scientific work,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
-
LAST
= 4¶
-
-
class
Vips.
Interesting
(value)¶ Bases:
GObject.GEnum
Pick the algorithm vips uses to decide image “interestingness”. This is used by vips_smartcrop(), for example, to decide what parts of the image to keep.
Vips.Interesting.NONE
andVips.Interesting.LOW
mean the same – the crop is positioned at the top or left.Vips.Interesting.HIGH
positions at the bottom or right.See also: vips_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
-
LAST
= 7¶
-
-
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
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.
-
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
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
-
LAST
= 30¶
-
-
class
Vips.
Kernel
(value)¶ Bases:
GObject.GEnum
The resampling kernels vips supports. See vips_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¶
-
LANCZOS2
= 4¶ Convolve with a two-lobe Lanczos kernel.
-
LANCZOS3
= 5¶ Convolve with a three-lobe Lanczos kernel.
-
LAST
= 6¶
-
-
class
Vips.
OperationBoolean
(value)¶ Bases:
GObject.GEnum
See also: vips_boolean().
-
AND
= 0¶ &
-
OR
= 1¶
-
EOR
= 2¶ ^
-
LSHIFT
= 3¶
-
RSHIFT
= 4¶ <<
-
LAST
= 5¶
-
-
class
Vips.
OperationComplex
(value)¶ Bases:
GObject.GEnum
See also: vips_complex().
-
POLAR
= 0¶ convert to polar coordinates
-
RECT
= 1¶ convert to rectangular coordinates
-
CONJ
= 2¶ complex conjugate
-
LAST
= 3¶
-
-
class
Vips.
OperationComplex2
(value)¶ Bases:
GObject.GEnum
See also: vips_complex2().
-
CROSS_PHASE
= 0¶ convert to polar coordinates
-
LAST
= 1¶
-
-
class
Vips.
OperationComplexget
(value)¶ Bases:
GObject.GEnum
See also: vips_complexget().
-
REAL
= 0¶ get real component
-
IMAG
= 1¶ get imaginary component
-
LAST
= 2¶
-
-
class
Vips.
OperationMath
(value)¶ Bases:
GObject.GEnum
See also: vips_math().
-
SIN
= 0¶ sin(), angles in degrees
-
COS
= 1¶ cos(), angles in degrees
-
LAST
= 10¶
-
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: vips_math().
-
POW
= 0¶ pow( left, right )
-
WOP
= 1¶ pow( right, left )
-
LAST
= 2¶
-
-
class
Vips.
OperationMorphology
(value)¶ Bases:
GObject.GEnum
More like hit-miss, really.
See also: vips_morph().
-
ERODE
= 0¶ true if all set
-
DILATE
= 1¶ true if one set
-
LAST
= 2¶
-
-
class
Vips.
OperationRelational
(value)¶ Bases:
GObject.GEnum
See also: vips_relational().
-
EQUAL
= 0¶ ==
-
NOTEQ
= 1¶ !=
-
LESS
= 2¶ <
-
LESSEQ
= 3¶ <=
-
MORE
= 4¶
-
MOREEQ
= 5¶ =
-
LAST
= 6¶
-
-
class
Vips.
OperationRound
(value)¶ Bases:
GObject.GEnum
See also: vips_round().
-
RINT
= 0¶ round to nearest
-
CEIL
= 1¶ the smallest integral value not less than
-
FLOOR
= 2¶ largest integral value not greater than
-
LAST
= 3¶
-
-
class
Vips.
PCS
(value)¶ Bases:
GObject.GEnum
Pick a Profile Connection Space for vips_icc_import() and vips_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
-
LAST
= 2¶
-
-
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
-
LAST
= 3¶
-
-
class
Vips.
RegionShrink
(value)¶ Bases:
GObject.GEnum
How to calculate the output pixels when shrinking a 2x2 region.
-
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
-
LAST
= 6¶
-
-
class
Vips.
Saveable
(value)¶ Bases:
GObject.GEnum
See also:
Vips.ForeignSave
.-
MONO
= 0¶ 1 band (eg. CSV)
-
RGB
= 1¶ 1 or 3 bands (eg. PPM)
-
RGBA
= 2¶ 1, 2, 3 or 4 bands (eg. PNG)
-
RGBA_ONLY
= 3¶ 3 or 4 bands (eg. WEBP)
-
RGB_CMYK
= 4¶ 1, 3 or 4 bands (eg. JPEG)
-
ANY
= 5¶ any number of bands (eg. TIFF)
-
LAST
= 6¶
-
-
class
Vips.
Size
(value)¶ Bases:
GObject.GEnum
Controls whether an operation should upsize, downsize, both up and downsize, or force a size.
See also: vips_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
-
LAST
= 4¶
-