Enum ImwriteFlags
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
The format type IDs for cv::imwrite and cv::inencode
public enum ImwriteFlags
Fields
AvifDepth = 513For AVIF, it can be 8, 10 or 12. If >8, it is stored/read as CV_16U. Default is 8.
AvifQuality = 512For AVIF, it can be a quality between 0 and 100 (the higher the better). Default is 95.
AvifSpeed = 514For AVIF, it is between 0 (slowest) and 10 (fastest). Default is 9.
BmpCompression = 768For BMP, use to specify compress parameter for 32bpp image. Default is IMWRITE_BMP_COMPRESSION_BITFIELDS. See cv::ImwriteBMPCompressionFlags.
ExrCompression = 49[49] override EXR compression type (ZIP_COMPRESSION = 3 is default)
ExrDwaCompressionLevel = 50[50] override EXR DWA compression level (45 is default)
ExrType = 48[48] override EXR storage type (FLOAT (FP32) is default)
GifColorTable = 1029For GIF, 0 means global color table is used, 1 means local color table is used. Default is 0.
GifDither = 1027For GIF, it can be a quality from -1 (most dither) to 3 (no dither). Default is 0.
GifLoop = 1024Not functional since 4.12.0. Replaced by cv::Animation::loop_count.
GifQuality = 1026For GIF, it can be a quality from 1 to 8. Default is 2. See cv::ImwriteGIFCompressionFlags.
GifSpeed = 1025Not functional since 4.12.0. Replaced by cv::Animation::durations.
GifTransparency = 1028For GIF, the alpha channel lower than this will be set to transparent. Default is 1.
HdrCompression = 80[80] Specify HDR compression. See cv::ImwriteHDRCompressionFlags.
Jpeg2000CompressionX1000 = 272For JPEG2000, use to specify the target compression rate (multiplied by 1000). The value can be from 0 to 1000. Default is 1000.
JpegChromaQuality = 6Separate chroma quality level, 0 - 100, default is 0 - don't use.
JpegLumaQuality = 5Separate luma quality level, 0 - 100, default is 0 - don't use.
JpegOptimize = 3Enable JPEG features, 0 or 1, default is False.
JpegProgressive = 2Enable JPEG features, 0 or 1, default is False.
JpegQuality = 1For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95.
JpegRstInterval = 4JPEG restart interval, 0 - 65535, default is 0 - no restart.
JpegSamplingFactor = 7For JPEG, set sampling factor. See cv::ImwriteJPEGSamplingFactorParams.
JpegXlDecodingSpeed = 643For JPEG XL, decoding speed tier for the provided options; minimum is 0 (slowest to decode, best quality/density), and maximum is 4 (fastest to decode, at the cost of some quality/density). Default is 0.
JpegXlDistance = 642For JPEG XL, distance level for lossy compression: target max butteraugli distance, lower = higher quality, 0 = lossless; range: 0..25. Default is 1.
JpegXlEffort = 641For JPEG XL, encoder effort/speed level without affecting decoding speed; it is between 1 (fastest) and 10 (slowest). Default is 7.
JpegXlQuality = 640For JPEG XL, it can be a quality from 0 to 100 (the higher is the better). Default value is 95. If set, distance parameter is re-calculated from quality level automatically. This parameter requires libjxl v0.10 or later.
PamTupleType = 128For PAM, sets the TUPLETYPE field to the corresponding string value that is defined for the format
PngBilevel = 18Binary level PNG, 0 or 1, default is 0.
PngCompression = 16For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. Default value is 3.
PngFilter = 19For PNG, One of cv::ImwritePNGFilterFlags, default is IMWRITE_PNG_FILTER_SUB. For APNG, it is not supported.
PngStrategy = 17One of cv::ImwritePNGFlags, default is IMWRITE_PNG_StrategyDEFAULT.
PngZlibBufferSize = 20For PNG with libpng, sets the size of the internal zlib compression buffer in bytes, from 6 to 1048576 (1024 KiB). Default is 8192 (8 KiB). If WITH_SPNG=ON, it is not supported. For APNG, it is not supported.
PxmBinary = 32For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1.
TiffCompression = 259For TIFF, use to specify the image compression scheme. See libtiff for integer constants corresponding to compression formats. Note, for images whose depth is CV_32F, only libtiff's SGILOG compression scheme is used. For other supported depths, the compression scheme can be specified by this flag; LZW compression is the default.
TiffPredictor = 317For TIFF, use to specify predictor. See cv::ImwriteTiffPredictorFlags. Default is IMWRITE_TIFF_PREDICTOR_HORIZONTAL.
TiffResUnit = 256For TIFF, use to specify which DPI resolution unit to set; see libtiff documentation for valid values
TiffRowsPerStrip = 278For TIFF, use to specify the number of rows per strip.
TiffXDpi = 257For TIFF, use to specify the X direction DPI
TiffYDpi = 258For TIFF, use to specify the Y direction DPI
WebPLosslessMode = 65For WEBP, it can be a lossless compression strategy. See cv::ImwriteWEBPLosslessMode. Default is IMWRITE_WEBP_LOSSLESS_OFF. For Animated WEBP, it is not supported.
WebPQuality = 64For WEBP, it can be a lossy quality from 1 to 100 (the higher is the better) for IMWRITE_WEBP_LOSSLESS_OFF. By default (without this parameter) or if quality > 100, lossless compression is used instead.