Skip to content

IMGCODECS Module API Reference

Complete documentation for the IMGCODECS classes, methods, and enums in OpenCV5Sharp. Equivalent to the Official OpenCV Imgcodecs Documentation.


📦 Classes and Structs

Animation

Inherits from: DisposableOpenCVObject

Represents an animation with multiple frames. The Animation struct is designed to store and manage data for animated sequences such as those from animated formats (e.g., GIF, AVIF, APNG, WebP). It provides support for looping, background color settings, frame timing, and frame storage.

Properties

PropertyTypeDescription
LoopCountintGets or sets the loop_count property.
BgcolorScalarGets or sets the bgcolor property.
Durationsint[]Gets or sets the durations property.
FramesMat[]Gets or sets the frames property.
StillImageMat?Gets or sets the still_image property.

Constructors

  • new Animation(int loopCount, Scalar bgColor)
    • Summary: Constructs an Animation object with optional loop count and background color.
    • Parameter loopCount: An integer representing the number of times the animation should loop: - 0 (default) indicates infinite looping, meaning the animation will replay continuously. - Positive values denote finite repeat counts, allowing the animation to play a limited number of times. - If a negative value or a value beyond the maximum of 0xffff (65535) is provided, it is reset to 0 (infinite looping) to maintain valid bounds.
    • Parameter bgColor: A Scalar object representing the background color in BGR format: - Defaults to Scalar(), indicating an empty color (usually transparent if supported). - This background color provides a solid fill behind frames that have transparency, ensuring a consistent display appearance.

⚙️ Static Methods (Cv2)

Cv2.Imread

Signature: Mat? Imread(string filename, int flags)

Loads an image from a file.

Detailed Remarks: The imread function loads an image from the specified file and returns OpenCV matrix. If the image cannot be read (because of a missing file, improper permissions, or unsupported/invalid format), the function returns an empty matrix. Currently, the following file formats are supported:

  • Windows bitmaps - *.bmp, *.dib (always supported)

  • GIF files - *.gif (always supported)

  • JPEG files - *.jpeg, *.jpg, *.jpe (see the Note section)

  • JPEG 2000 files - *.jp2 (see the Note section)

  • Portable Network Graphics - *.png (see the Note section)

  • WebP - *.webp (see the Note section)

  • AVIF - *.avif (see the Note section)

  • Portable image format - *.pbm, *.pgm, *.ppm, *.pxm, *.pnm (always supported)

  • PFM files - *.pfm (see the Note section)

  • Sun rasters - *.sr, *.ras (always supported)

  • TIFF files - *.tiff, *.tif (see the Note section)

  • OpenEXR Image files - *.exr (see the Note section)

  • Radiance HDR - *.hdr, *.pic (always supported)

  • Raster and Vector geospatial data supported by GDAL (see the Note section) .: info Note

  • The function determines the type of an image by its content, not by the file extension.

  • In the case of color images, the decoded images will have the channels stored in B G R order.

  • When using IMREAD_GRAYSCALE, the codec's internal grayscale conversion will be used, if available. Results may differ from the output of cvtColor().

  • On Microsoft Windows* and Mac OS*, the codecs shipped with OpenCV (libjpeg, libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs, and TIFFs. On Mac OS, there is also an option to use native Mac OS image readers. However, beware that currently these native image loaders give images with different pixel values because of the color management embedded into Mac OS.

  • On Linux*, BSD flavors, and other Unix-like open-source operating systems, OpenCV looks for codecs supplied with the OS. Ensure the relevant packages are installed (including development files, such as "libjpeg-dev" in Debian* and Ubuntu*) to get codec support, or turn on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake.

  • If the WITH_GDAL flag is set to true in CMake and IMREAD_LOAD_GDAL is used to load the image, the GDAL driver will be used to decode the image, supporting Raster and Vector formats.

  • If EXIF information is embedded in the image file, the EXIF orientation will be taken into account, and thus the image will be rotated accordingly unless the flags IMREAD_IGNORE_ORIENTATION or IMREAD_UNCHANGED are passed.

  • Use the IMREAD_UNCHANGED flag to preserve the floating-point values from PFM images.

  • By default, the number of pixels must be less than 2^30. This limit can be changed by setting the environment variable OPENCV_IO_MAX_IMAGE_PIXELS. See tutorial_env_reference. .:

Parameters:

  • filename: Name of the file to be loaded.
  • flags: Flag that can take values of ImreadModes, default with IMREAD_COLOR_BGR.

Returns: The returned value.


Cv2.Imread

Signature: void Imread(string filename, Mat dst, int flags)

Loads an image from a file.

Detailed Remarks: This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts and the return value. .: info Note

The image passing through the img parameter can be pre-allocated. The memory is reused if the shape and the type match with the load image. .:

Parameters:

  • filename: Name of file to be loaded.
  • dst: object in which the image will be loaded.
  • flags: Flag that can take values of ImreadModes, default with IMREAD_COLOR_BGR.

Cv2.ImreadWithMetadata

Signature: Mat? ImreadWithMetadata(string filename, IntPtr metadataTypes, IntPtr metadata, int flags)

Reads an image from a file along with associated metadata.

Detailed Remarks: This function behaves similarly to imread(), loading an image from the specified file. In addition to the image pixel data, it also attempts to extract any available metadata embedded in the file (such as EXIF, XMP, etc.), depending on file format support. .: info Note In the case of color images, the decoded images will have the channels stored in B G R order. .:

Parameters:

  • filename: Name of the file to be loaded.
  • metadataTypes: Output vector with types of metadata chunks returned in metadata, see ImageMetadataType.
  • metadata: Output arrays of matrices or vector of matrices to store the retrieved metadata.
  • flags: Flag that can take values of ImreadModes.

Returns: The loaded image as a Mat object. If the image cannot be read, the function returns an empty matrix.


Cv2.Imreadmulti

Signature: bool Imreadmulti(string filename, IntPtr mats, int flags)

Loads a multi-page image from a file.

Detailed Remarks: The function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects. .: info Note The default flags value was changed from IMREAD_ANYCOLOR to IMREAD_COLOR_BGR for unification. See also: imread .:

Parameters:

  • filename: Name of file to be loaded.
  • mats: A vector of Mat objects holding each page.
  • flags: Flag that can take values of ImreadModes, default with IMREAD_COLOR_BGR.

Returns: The returned value.


Cv2.Imreadmulti

Signature: bool Imreadmulti(string filename, IntPtr mats, int start, int count, int flags)

Loads images of a multi-page image from a file.

Detailed Remarks: The function imreadmulti loads a specified range from a multi-page image from the specified file into a vector of Mat objects. See also: imread

Parameters:

  • filename: Name of file to be loaded.
  • mats: A vector of Mat objects holding each page.
  • start: Start index of the image to load
  • count: Count number of images to load
  • flags: Flag that can take values of ImreadModes, default with IMREAD_ANYCOLOR.

Returns: The returned value.


Cv2.Imreadanimation

Signature: bool Imreadanimation(string filename, Animation animation, int start, int count)

Loads frames from an animated image file into an Animation structure.

Detailed Remarks: The function imreadanimation loads frames from an animated image file (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.

Parameters:

  • filename: A string containing the path to the file.
  • animation: A reference to an Animation structure where the loaded frames will be stored. It should be initialized before the function is called.
  • start: The index of the first frame to load. This is optional and defaults to 0.
  • count: The number of frames to load. This is optional and defaults to 32767.

Returns: Returns true if the file was successfully loaded and frames were extracted; returns false otherwise.


Cv2.Imdecodeanimation

Signature: bool Imdecodeanimation(Mat buf, Animation animation, int start, int count)

Loads frames from an animated image buffer into an Animation structure.

Detailed Remarks: The function imdecodeanimation loads frames from an animated image buffer (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.

Parameters:

  • buf: A reference to a Mat containing the image buffer.
  • animation: A reference to an Animation structure where the loaded frames will be stored. It should be initialized before the function is called.
  • start: The index of the first frame to load. This is optional and defaults to 0.
  • count: The number of frames to load. This is optional and defaults to 32767.

Returns: Returns true if the buffer was successfully loaded and frames were extracted; returns false otherwise.


Cv2.Imwriteanimation

Signature: bool Imwriteanimation(string filename, Animation animation, IntPtr @params)

Saves an Animation to a specified file.

Detailed Remarks: The function imwriteanimation saves the provided Animation data to the specified file in an animated format. Supported formats depend on the implementation and may include formats like GIF, AVIF, APNG, or WEBP.

Parameters:

  • filename: The name of the file where the animation will be saved. The file extension determines the format.
  • animation: A constant reference to an Animation struct containing the frames and metadata to be saved.
  • params: Optional format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ...). These parameters are used to specify additional options for the encoding process. Refer to ImwriteFlags for details on possible parameters.

Returns: Returns true if the animation was successfully saved; returns false otherwise.


Cv2.Imencodeanimation

Signature: bool Imencodeanimation(string ext, Animation animation, IntPtr buf, IntPtr @params)

Encodes an Animation to a memory buffer.

Detailed Remarks: The function imencodeanimation encodes the provided Animation data into a memory buffer in an animated format. Supported formats depend on the implementation and may include formats like GIF, AVIF, APNG, or WEBP.

Parameters:

  • ext: The file extension that determines the format of the encoded data.
  • animation: A constant reference to an Animation struct containing the frames and metadata to be encoded.
  • buf: A reference to a vector of unsigned chars where the encoded data will be stored.
  • params: Optional format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ...). These parameters are used to specify additional options for the encoding process. Refer to ImwriteFlags for details on possible parameters.

Returns: Returns true if the animation was successfully encoded; returns false otherwise.


Cv2.Imcount

Signature: long Imcount(string filename, int flags)

Returns the number of images inside the given file

Detailed Remarks: The function imcount returns the number of pages in a multi-page image (e.g. TIFF), the number of frames in an animation (e.g. AVIF), and 1 otherwise. If the image cannot be decoded, 0 is returned. .: info Note The default flags value was changed from IMREAD_ANYCOLOR to IMREAD_COLOR_BGR for unification. When IMREAD_LOAD_GDAL flag is used the return value will be 0 or 1 because OpenCV's GDAL decoder doesn't support multi-page reading yet. .:

Parameters:

  • filename: Name of file to be loaded.
  • flags: Flag that can take values of ImreadModes, default with IMREAD_COLOR_BGR.

Returns: The returned value.


Cv2.Imwrite

Signature: bool Imwrite(string filename, Mat img, IntPtr @params)

Saves an image to a specified file.

Detailed Remarks: The function imwrite saves the image to the specified file. The image format is chosen based on the filename extension (see imread for the list of extensions). In general, only 8-bit unsigned (CV_8U) single-channel or 3-channel (with 'BGR' channel order) images can be saved using this function, with these exceptions:

  • With BMP encoder, 8-bit unsigned (CV_8U) images can be saved.
  • BMP images with an alpha channel can be saved using this function. To achieve this, create an 8-bit 4-channel (CV_8UC4) BGRA image, ensuring the alpha channel is the last component. Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255. OpenCV v4.13.0 or later use BI_BITFIELDS compression as default. See IMWRITE_BMP_COMPRESSION.
  • With OpenEXR encoder, only 32-bit float (CV_32F) images can be saved. More than 4 channels can be saved. (imread can load it then.)
  • 8-bit unsigned (CV_8U) images are not supported.
  • With Radiance HDR encoder, non 64-bit float (CV_64F) images can be saved.
  • All images will be converted to 32-bit float (CV_32F).
  • With JPEG 2000 encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
  • With JPEG XL encoder, 8-bit unsigned (CV_8U), 16-bit unsigned (CV_16U) and 32-bit float(CV_32F) images can be saved.
  • JPEG XL images with an alpha channel can be saved using this function. To achieve this, create an 8-bit 4-channel (CV_8UC4) / 16-bit 4-channel (CV_16UC4) / 32-bit float 4-channel (CV_32FC4) BGRA image, ensuring the alpha channel is the last component. Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255/65535/1.0.
  • With PAM encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
  • With PNG encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
  • PNG images with an alpha channel can be saved using this function. To achieve this, create an 8-bit 4-channel (CV_8UC4) / 16-bit 4-channel (CV_16UC4) BGRA image, ensuring the alpha channel is the last component. Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255/65535(see the code sample below).
  • With PGM/PPM encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
  • With TIFF encoder, 8-bit unsigned (CV_8U), 8-bit signed (CV_8S), 16-bit unsigned (CV_16U), 16-bit signed (CV_16S), 32-bit unsigned (CV_32U), 32-bit signed (CV_32S), 64-bit unsigned (CV_64U), 64-bit signed (CV_64S), 32-bit float (CV_32F) and 64-bit float (CV_64F) images can be saved.
  • Multiple images (vector of Mat) can be saved in TIFF format (see the code sample below).
  • 32-bit float 3-channel (CV_32FC3) TIFF images can be saved using the LogLuv high dynamic range encoding (4 bytes per pixel) through TIFF_COMPRESSION_SGILOG or (3 bytes per pixel) through TIFF_COMPRESSION_SGILOG24.
  • Other compression schemes (LZW...) are supported as well for 32F depth, but the efficiency might not be very good for the floating-point representation bit patterns.
  • With GIF encoder, 8-bit unsigned (CV_8U) images can be saved.
  • GIF images with an alpha channel can be saved using this function. To achieve this, create an 8-bit 4-channel (CV_8UC4) BGRA image, ensuring the alpha channel is the last component. Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255.
  • 8-bit single-channel images (CV_8UC1) are not supported due to GIF's limitation to indexed color formats.
  • With AVIF encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
  • CV_16U images can be saved as only 10-bit or 12-bit (not 16-bit). See IMWRITE_AVIF_DEPTH.
  • AVIF images with an alpha channel can be saved using this function. To achieve this, create an 8-bit 4-channel (CV_8UC4) / 16-bit 4-channel (CV_16UC4) BGRA image, ensuring the alpha channel is the last component. Fully transparent pixels should have an alpha value of 0, while fully opaque pixels should have an alpha value of 255 (8-bit) / 1023 (10-bit) / 4095 (12-bit) (see the code sample below). If the image format is not supported, the image will be converted to 8-bit unsigned (CV_8U) and saved that way. If the format, depth or channel order is different, use Mat.ConvertTo and cvtColor to convert it before saving. Or, use the universal FileStorage I/O functions to save the image to XML or YAML format. The sample below shows how to create a BGRA image, how to set custom compression parameters and save it to a PNG file. It also demonstrates how to save multiple images in a TIFF file: See example in OpenCV documentation. Parameters:
  • filename: Name of the file.
  • img: (Mat or vector of Mat) Image or Images to be saved.
  • params: Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see ImwriteFlags

Returns: true if the image is successfully written to the specified file; false otherwise.


Cv2.ImwriteWithMetadata

Signature: bool ImwriteWithMetadata(string filename, Mat img, IntPtr metadataTypes, IntPtr metadata, IntPtr @params)

Saves an image to a specified file with metadata

Detailed Remarks: The function imwriteWithMetadata saves the image to the specified file. It does the same thing as imwrite, but additionally writes metadata if the corresponding format supports it.

Parameters:

  • filename: Name of the file. As with imwrite, image format is determined by the file extension.
  • img: (Mat or vector of Mat) Image or Images to be saved.
  • metadataTypes: Vector with types of metadata chucks stored in metadata to write, see ImageMetadataType.
  • metadata: Vector of vectors or vector of matrices with chunks of metadata to store into the file
  • params: Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see ImwriteFlags

Returns: The returned value.


Cv2.Imwritemulti

Signature: bool Imwritemulti(string filename, IntPtr img, IntPtr @params)

Wrapper for OpenCV's native functionality.

Parameters:

  • filename: Path to the file.
  • img: Input image.
  • params: The @params parameter.

Returns: The returned value.


Cv2.Imdecode

Signature: Mat? Imdecode(Mat buf, int flags)

Reads an image from a buffer in memory.

Detailed Remarks: The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or contains invalid data, the function returns an empty matrix ( Mat.Data == IntPtr.Zero ). See imread for the list of supported formats and flags description. .: info Note In the case of color images, the decoded images will have the channels stored in B G R order. .:

Parameters:

  • buf: Input array or vector of bytes.
  • flags: Flag that can take values of ImreadModes.

Returns: The returned value.


Cv2.ImdecodeWithMetadata

Signature: Mat? ImdecodeWithMetadata(Mat buf, IntPtr metadataTypes, IntPtr metadata, int flags)

Reads an image from a memory buffer and extracts associated metadata.

Detailed Remarks: This function decodes an image from the specified memory buffer. If the buffer is too short or contains invalid data, the function returns an empty matrix ( Mat.Data == IntPtr.Zero ). See imread for the list of supported formats and flags description. .: info Note In the case of color images, the decoded images will have the channels stored in B G R order. .:

Parameters:

  • buf: Input array or vector of bytes containing the encoded image data.
  • metadataTypes: Output vector with types of metadata chucks returned in metadata, see ImageMetadataType
  • metadata: Output arrays of matrices or vector of matrices to store the retrieved metadata
  • flags: Flag that can take values of ImreadModes.

Returns: The decoded image as a Mat object. If decoding fails, the function returns an empty matrix.


Cv2.Imdecodemulti

Signature: bool Imdecodemulti(Mat buf, int flags, IntPtr mats, Range range)

Reads a multi-page image from a buffer in memory.

Detailed Remarks: The function imdecodemulti reads a multi-page image from the specified buffer in the memory. If the buffer is too short or contains invalid data, the function returns false. See imreadmulti for the list of supported formats and flags description. .: info Note In the case of color images, the decoded images will have the channels stored in B G R order. .:

Parameters:

  • buf: Input array or vector of bytes.
  • flags: Flag that can take values of ImreadModes.
  • mats: A vector of Mat objects holding each page, if more than one.
  • range: A continuous selection of pages.

Returns: The returned value.


Cv2.Imencode

Signature: bool Imencode(string ext, Mat img, IntPtr buf, IntPtr @params)

Encodes an image into a memory buffer.

Detailed Remarks: The function imencode compresses the image and stores it in the memory buffer that is resized to fit the result. See imwrite for the list of supported formats and flags description.

Parameters:

  • ext: File extension that defines the output format. Must include a leading period.
  • img: Image to be compressed.
  • buf: Output buffer resized to fit the compressed image.
  • params: Format-specific parameters. See imwrite and ImwriteFlags.

Returns: The returned value.


Cv2.ImencodeWithMetadata

Signature: bool ImencodeWithMetadata(string ext, Mat img, IntPtr metadataTypes, IntPtr metadata, IntPtr buf, IntPtr @params)

Encodes an image into a memory buffer.

Detailed Remarks: The function imencode compresses the image and stores it in the memory buffer that is resized to fit the result. See imwrite for the list of supported formats and flags description.

Parameters:

  • ext: File extension that defines the output format. Must include a leading period.
  • img: Image to be compressed.
  • metadataTypes: Vector with types of metadata chucks stored in metadata to write, see ImageMetadataType.
  • metadata: Vector of vectors or vector of matrices with chunks of metadata to store into the file
  • buf: Output buffer resized to fit the compressed image.
  • params: Format-specific parameters. See imwrite and ImwriteFlags.

Returns: The returned value.


Cv2.Imencodemulti

Signature: bool Imencodemulti(string ext, IntPtr imgs, IntPtr buf, IntPtr @params)

Encodes array of images into a memory buffer.

Detailed Remarks: The function is analog to imencode for in-memory multi-page image compression. See imwrite for the list of supported formats and flags description.

Parameters:

  • ext: File extension that defines the output format. Must include a leading period.
  • imgs: Vector of images to be written.
  • buf: Output buffer resized to fit the compressed data.
  • params: Format-specific parameters. See imwrite and ImwriteFlags.

Returns: The returned value.


Cv2.HaveImageReader

Signature: bool HaveImageReader(string filename)

Checks if the specified image file can be decoded by OpenCV.

Detailed Remarks: The function haveImageReader checks if OpenCV is capable of reading the specified file. This can be useful for verifying support for a given image format before attempting to load an image. .: info Note The function checks the availability of image codecs that are either built into OpenCV or dynamically loaded. It does not load the image codec implementation and decode data, but uses signature check. If the file cannot be opened or the format is unsupported, the function will return false. See also: haveImageWriter, imread, imdecode .:

Parameters:

  • filename: The name of the file to be checked.

Returns: true if an image reader for the specified file is available and the file can be opened, false otherwise.


Cv2.HaveImageWriter

Signature: bool HaveImageWriter(string filename)

Checks if the specified image file or specified file extension can be encoded by OpenCV.

Detailed Remarks: The function haveImageWriter checks if OpenCV is capable of writing images with the specified file extension. This can be useful for verifying support for a given image format before attempting to save an image. .: info Note The function checks the availability of image codecs that are either built into OpenCV or dynamically loaded. It does not check for the actual existence of the file but rather the ability to write files of the given type. See also: haveImageReader, imwrite, imencode .:

Parameters:

  • filename: The name of the file or the file extension (e.g., ".jpg", ".png"). It is recommended to provide the file extension rather than the full file name.

Returns: true if an image writer for the specified extension is available, false otherwise.


🔢 Enumerations

ImageMetadataType

Wrapper for OpenCV's native functionality.

MemberValueDescription
Unknown-1Unknown
Exif0Exif
Xmp1Xmp
Iccp2Iccp
Cicp3Cicp
Max3Max

ImreadModes

Wrapper for OpenCV's native functionality.

MemberValueDescription
Unchanged-1Unchanged
Grayscale0Grayscale
ColorBgr1ColorBgr
Color1Color
Anydepth2Anydepth
Anycolor4Anycolor
LoadGdal8LoadGdal
ReducedGrayscale216ReducedGrayscale2
ReducedColor217ReducedColor2
ReducedGrayscale432ReducedGrayscale4
ReducedColor433ReducedColor4
ReducedGrayscale864ReducedGrayscale8
ReducedColor865ReducedColor8
IgnoreOrientation128IgnoreOrientation
ColorRgb256ColorRgb

ImwriteBMPCompressionFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
Rgb0Rgb
Bitfields3Bitfields

ImwriteEXRCompressionFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
No0No
Rle1Rle
Zips2Zips
Zip3Zip
Piz4Piz
Pxr245Pxr24
B446B44
B44a7B44a
Dwaa8Dwaa
Dwab9Dwab

ImwriteEXRTypeFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
Half1Half
Float2Float

ImwriteFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
JpegQuality1JpegQuality
JpegProgressive2JpegProgressive
JpegOptimize3JpegOptimize
JpegRstInterval4JpegRstInterval
JpegLumaQuality5JpegLumaQuality
JpegChromaQuality6JpegChromaQuality
JpegSamplingFactor7JpegSamplingFactor
PngCompression16PngCompression
PngStrategy17PngStrategy
PngBilevel18PngBilevel
PngFilter19PngFilter
PngZlibbufferSize20PngZlibbufferSize
PxmBinary32PxmBinary
ExrTypeunchecked((int)(3 << 4 + 0))ExrType
ExrCompressionunchecked((int)(3 << 4 + 1))ExrCompression
ExrDwaCompressionLevelunchecked((int)(3 << 4 + 2))ExrDwaCompressionLevel
WebpQuality64WebpQuality
WebpLosslessMode65WebpLosslessMode
HdrCompressionunchecked((int)(5 << 4 + 0))HdrCompression
PamTupletype128PamTupletype
TiffResunit256TiffResunit
TiffXdpi257TiffXdpi
TiffYdpi258TiffYdpi
TiffCompression259TiffCompression
TiffRowsperstrip278TiffRowsperstrip
TiffPredictor317TiffPredictor
Jpeg2000CompressionX1000272Jpeg2000CompressionX1000
AvifQuality512AvifQuality
AvifDepth513AvifDepth
AvifSpeed514AvifSpeed
JpegxlQuality640JpegxlQuality
JpegxlEffort641JpegxlEffort
JpegxlDistance642JpegxlDistance
JpegxlDecodingSpeed643JpegxlDecodingSpeed
BmpCompression768BmpCompression
GifLoop1024GifLoop
GifSpeed1025GifSpeed
GifQuality1026GifQuality
GifDither1027GifDither
GifTransparency1028GifTransparency
GifColortable1029GifColortable

ImwriteGIFCompressionFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
FastNoDither1FastNoDither
FastFloydDither2FastFloydDither
ColortableSize83ColortableSize8
ColortableSize164ColortableSize16
ColortableSize325ColortableSize32
ColortableSize646ColortableSize64
ColortableSize1287ColortableSize128
ColortableSize2568ColortableSize256

ImwriteHDRCompressionFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
None0None
Rle1Rle

ImwriteJPEGSamplingFactorParams

Wrapper for OpenCV's native functionality.

MemberValueDescription
_411unchecked((int)(0x411111))_411
_420unchecked((int)(0x221111))_420
_422unchecked((int)(0x211111))_422
_440unchecked((int)(0x121111))_440
_444unchecked((int)(0x111111))_444

ImwritePAMFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
Null0Null
Blackandwhite1Blackandwhite
Grayscale2Grayscale
GrayscaleAlpha3GrayscaleAlpha
Rgb4Rgb
RgbAlpha5RgbAlpha

ImwritePNGFilterFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
FilterNone8FilterNone
FilterSub16FilterSub
FilterUp32FilterUp
FilterAvg64FilterAvg
FilterPaeth128FilterPaeth
FastFilters`unchecked((int)(FilterNoneFilterSub
AllFilters`unchecked((int)(FastFiltersFilterAvg

ImwritePNGFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
Default0Default
Filtered1Filtered
HuffmanOnly2HuffmanOnly
Rle3Rle
Fixed4Fixed

ImwriteTiffCompressionFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
None1None
Ccittrle2Ccittrle
Ccittfax33Ccittfax3
CcittT43CcittT4
Ccittfax44Ccittfax4
CcittT64CcittT6
Lzw5Lzw
Ojpeg6Ojpeg
Jpeg7Jpeg
T859T85
T4310T43
Next32766Next
Ccittrlew32771Ccittrlew
Packbits32773Packbits
Thunderscan32809Thunderscan
It8ctpad32895It8ctpad
It8lw32896It8lw
It8mp32897It8mp
It8bl32898It8bl
Pixarfilm32908Pixarfilm
Pixarlog32909Pixarlog
Deflate32946Deflate
AdobeDeflate8AdobeDeflate
Dcs32947Dcs
Jbig34661Jbig
Sgilog34676Sgilog
Sgilog2434677Sgilog24
Jp200034712Jp2000
Lerc34887Lerc
Lzma34925Lzma
Zstd50000Zstd
Webp50001Webp
Jxl50002Jxl

ImwriteTiffPredictorFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
None1None
Horizontal2Horizontal
Floatingpoint3Floatingpoint

ImwriteTiffResolutionUnitFlags

Wrapper for OpenCV's native functionality.

MemberValueDescription
None1None
Inch2Inch
Centimeter3Centimeter

ImwriteWEBPLosslessMode

Wrapper for OpenCV's native functionality.

MemberValueDescription
Off0Off
On1On
PreserveColor2PreserveColor

Released under the Apache 2.0 and LGPL 2.1 Licenses.