Skip to content

encodeImage

TypeScript helpershelperOpenCV 5.0.0
import { encodeImage } from '@banou/opencv-wasm'
ARGUMENTSSee signature below
HELPERencodeImage
RETURN TYPEUint8Array<ArrayBuffer>
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Encode a shared-engine matrix to independent image bytes; no DOM is required. Extension starts with a dot, such as .png. Native colour codecs expect BGR or BGRA. Parameters are alternating IMWRITE identifiers and values. Throws if encoding fails.

export declare function encodeImage(extension: string, mat: Mat, parameters?: readonly number[]): Uint8Array<ArrayBuffer>;

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.