Skip to content

imwriteWithMetadata

Image codecsfunctionOpenCV 5.0.0
import { imwriteWithMetadata } from '@banou/opencv-wasm'

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

ARGUMENTSfilename, img, metadataTypes, metadata
FUNCTIONimwriteWithMetadata
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Saves an image to a specified file with metadata

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.

imwriteWithMetadata(filename: EmbindString, img: Mat, metadataTypes: IntVector, metadata: MatVector, params: IntVector): boolean;
2 available overloads
imwriteWithMetadata(filename: EmbindString, img: Mat, metadataTypes: IntVector, metadata: MatVector): boolean;
imwriteWithMetadata(filename: EmbindString, img: Mat, metadataTypes: IntVector, metadata: MatVector, params: IntVector): boolean;
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 cv::ImwriteFlags

Returns

The boolean result.

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.