Skip to content

ImwriteFlags

Image codecsclassOpenCV 5.0.0
import { ImwriteFlags } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSImwriteFlags
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods.

ImwriteFlags: Imwrite flags

Constructors and members

static IMWRITE_JPEG_QUALITY

For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95.

IMWRITE_JPEG_QUALITY: ImwriteFlagsValue<1>,

static IMWRITE_JPEG_PROGRESSIVE

Enable JPEG features, 0 or 1, default is False.

IMWRITE_JPEG_PROGRESSIVE: ImwriteFlagsValue<2>,

static IMWRITE_JPEG_OPTIMIZE

Enable JPEG features, 0 or 1, default is False.

IMWRITE_JPEG_OPTIMIZE: ImwriteFlagsValue<3>,

static IMWRITE_JPEG_RST_INTERVAL

JPEG restart interval, 0 - 65535, default is 0 - no restart.

IMWRITE_JPEG_RST_INTERVAL: ImwriteFlagsValue<4>,

static IMWRITE_JPEG_LUMA_QUALITY

Separate luma quality level, 0 - 100, default is -1 - don't use. If JPEG_LIB_VERSION < 70, Not supported.

IMWRITE_JPEG_LUMA_QUALITY: ImwriteFlagsValue<5>,

static IMWRITE_JPEG_CHROMA_QUALITY

Separate chroma quality level, 0 - 100, default is -1 - don't use. If JPEG_LIB_VERSION < 70, Not supported.

IMWRITE_JPEG_CHROMA_QUALITY: ImwriteFlagsValue<6>,

static IMWRITE_JPEG_SAMPLING_FACTOR

For JPEG, set sampling factor. See cv::ImwriteJPEGSamplingFactorParams.

IMWRITE_JPEG_SAMPLING_FACTOR: ImwriteFlagsValue<7>,

static IMWRITE_PNG_COMPRESSION

For PNG, it can be the compression level from 0 to 9. A higher value means a smaller size and longer compression time. If specified, strategy is changed to IMWRITE_PNG_STRATEGY_DEFAULT (Z_DEFAULT_STRATEGY). Default value is 1 (best speed setting).

IMWRITE_PNG_COMPRESSION: ImwriteFlagsValue<16>,

static IMWRITE_PNG_STRATEGY

For PNG, One of cv::ImwritePNGFlags, default is IMWRITE_PNG_STRATEGY_RLE.

IMWRITE_PNG_STRATEGY: ImwriteFlagsValue<17>,

static IMWRITE_PNG_BILEVEL

For PNG, Binary level PNG, 0 or 1, default is 0. For APNG, it is not supported.

IMWRITE_PNG_BILEVEL: ImwriteFlagsValue<18>,

static IMWRITE_PNG_FILTER

For PNG, One of cv::ImwritePNGFilterFlags, default is IMWRITE_PNG_FILTER_SUB. For APNG, it is not supported.

IMWRITE_PNG_FILTER: ImwriteFlagsValue<19>,

static IMWRITE_PNG_ZLIBBUFFER_SIZE

For 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). For normal use, 131072(128 KiB) or 262144(256 KiB) may be sufficient. If WITH_SPNG=ON, it is not supported. For APNG, it is not supported.

IMWRITE_PNG_ZLIBBUFFER_SIZE: ImwriteFlagsValue<20>,

static IMWRITE_PXM_BINARY

For PPM, PGM, or PBM, it can be a binary format flag, 0 or 1. Default value is 1.

IMWRITE_PXM_BINARY: ImwriteFlagsValue<32>,

static IMWRITE_EXR_TYPE

48 * /, //!< override EXR storage type (FLOAT (FP32) is default)

IMWRITE_EXR_TYPE: ImwriteFlagsValue<48>,

static IMWRITE_EXR_COMPRESSION

49 * /, //!< override EXR compression type (ZIP_COMPRESSION = 3 is default)

IMWRITE_EXR_COMPRESSION: ImwriteFlagsValue<49>,

static IMWRITE_EXR_DWA_COMPRESSION_LEVEL

50 * /, //!< override EXR DWA compression level (45 is default)

IMWRITE_EXR_DWA_COMPRESSION_LEVEL: ImwriteFlagsValue<50>,

static IMWRITE_WEBP_QUALITY

For 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, IMWRITE_WEBP_LOSSLESS_ON is used instead.

IMWRITE_WEBP_QUALITY: ImwriteFlagsValue<64>,

static IMWRITE_WEBP_LOSSLESS_MODE

For WEBP, it can be a lossless compression strategy. See cv::ImwriteWEBPLosslessMode. Default is IMWRITE_WEBP_LOSSLESS_OFF. For Animated WEBP, it is not supported.

IMWRITE_WEBP_LOSSLESS_MODE: ImwriteFlagsValue<65>,

static IMWRITE_HDR_COMPRESSION

80 * /, //!< specify HDR compression

IMWRITE_HDR_COMPRESSION: ImwriteFlagsValue<80>,

static IMWRITE_PAM_TUPLETYPE

For PAM, sets the TUPLETYPE field to the corresponding string value that is defined for the format

IMWRITE_PAM_TUPLETYPE: ImwriteFlagsValue<128>,

static IMWRITE_TIFF_RESUNIT

For TIFF, use to specify which DPI resolution unit to set. See ImwriteTiffResolutionUnitFlags. Default is IMWRITE_TIFF_RESOLUTION_UNIT_INCH.

IMWRITE_TIFF_RESUNIT: ImwriteFlagsValue<256>,

static IMWRITE_TIFF_XDPI

For TIFF, use to specify the X direction DPI

IMWRITE_TIFF_XDPI: ImwriteFlagsValue<257>,

static IMWRITE_TIFF_YDPI

For TIFF, use to specify the Y direction DPI

IMWRITE_TIFF_YDPI: ImwriteFlagsValue<258>,

static IMWRITE_TIFF_COMPRESSION

For TIFF, use to specify the image compression scheme. See cv::ImwriteTiffCompressionFlags. The compression scheme can be specified by this flag; the default is LZW compression, except for 32F depth where it is NONE

IMWRITE_TIFF_COMPRESSION: ImwriteFlagsValue<259>,

static IMWRITE_TIFF_ROWSPERSTRIP

For TIFF, use to specify the number of rows per strip.

IMWRITE_TIFF_ROWSPERSTRIP: ImwriteFlagsValue<278>,

static IMWRITE_TIFF_PREDICTOR

For TIFF, use to specify predictor. See cv::ImwriteTiffPredictorFlags. Default is IMWRITE_TIFF_PREDICTOR_HORIZONTAL .

IMWRITE_TIFF_PREDICTOR: ImwriteFlagsValue<317>,

static IMWRITE_JPEG2000_COMPRESSION_X1000

For JPEG2000, use to specify the target compression rate (multiplied by 1000). The value can be from 0 to 1000. Default is 1000.

IMWRITE_JPEG2000_COMPRESSION_X1000: ImwriteFlagsValue<272>,

static IMWRITE_AVIF_QUALITY

For AVIF, it can be a quality between 0 and 100 (the higher the better). Default is 95.

IMWRITE_AVIF_QUALITY: ImwriteFlagsValue<512>,

static IMWRITE_AVIF_DEPTH

For AVIF, it can be 8, 10 or 12. If >8, it is stored/read as CV_16U. Default is 8.

IMWRITE_AVIF_DEPTH: ImwriteFlagsValue<513>,

static IMWRITE_AVIF_SPEED

For AVIF, it is between 0 (slowest) and 10(fastest). Default is 9.

IMWRITE_AVIF_SPEED: ImwriteFlagsValue<514>,

static IMWRITE_JPEGXL_QUALITY

For 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-calicurated from quality level automatically. This parameter request libjxl v0.10 or later.

IMWRITE_JPEGXL_QUALITY: ImwriteFlagsValue<640>,

static IMWRITE_JPEGXL_EFFORT

For JPEG XL, encoder effort/speed level without affecting decoding speed; it is between 1 (fastest) and 10 (slowest). Default is 7.

IMWRITE_JPEGXL_EFFORT: ImwriteFlagsValue<641>,

static IMWRITE_JPEGXL_DISTANCE

For JPEG XL, distance level for lossy compression: target max butteraugli distance, lower = higher quality, 0 = lossless; range: 0 .. 25. Default is 1.

IMWRITE_JPEGXL_DISTANCE: ImwriteFlagsValue<642>,

static IMWRITE_JPEGXL_DECODING_SPEED

For 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.

IMWRITE_JPEGXL_DECODING_SPEED: ImwriteFlagsValue<643>,

static IMWRITE_BMP_COMPRESSION

For BMP, use to specify compress parameter for 32bpp image. Default is IMWRITE_BMP_COMPRESSION_BITFIELDS. See cv::ImwriteBMPCompressionFlags.

IMWRITE_BMP_COMPRESSION: ImwriteFlagsValue<768>,

static IMWRITE_GIF_LOOP

Not functional since 4.12.0. Replaced by cv::Animation::loop_count.

IMWRITE_GIF_LOOP: ImwriteFlagsValue<1024>,

static IMWRITE_GIF_SPEED

Not functional since 4.12.0. Replaced by cv::Animation::durations.

IMWRITE_GIF_SPEED: ImwriteFlagsValue<1025>,

static IMWRITE_GIF_QUALITY

For GIF, it can be a quality from 1 to 8. Default is 2. See cv::ImwriteGifCompressionFlags.

IMWRITE_GIF_QUALITY: ImwriteFlagsValue<1026>,

static IMWRITE_GIF_DITHER

For GIF, it can be a quality from -1(most dither) to 3(no dither). Default is 0.

IMWRITE_GIF_DITHER: ImwriteFlagsValue<1027>,

static IMWRITE_GIF_TRANSPARENCY

For GIF, the alpha channel lower than this will be set to transparent. Default is 1.

IMWRITE_GIF_TRANSPARENCY: ImwriteFlagsValue<1028>,

static IMWRITE_GIF_COLORTABLE

For GIF, 0 means global color table is used, 1 means local color table is used. Default is 0.

IMWRITE_GIF_COLORTABLE: ImwriteFlagsValue<1029>

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.