Skip to content

imwriteanimation

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

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

ARGUMENTSfilename, animation, params
FUNCTIONimwriteanimation
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Saves an Animation to a specified file.

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.

imwriteanimation(filename: EmbindString, animation: Animation, params: IntVector): boolean;
2 available overloads
imwriteanimation(filename: EmbindString, animation: Animation): boolean;
imwriteanimation(filename: EmbindString, animation: Animation, params: IntVector): boolean;
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 cv::ImwriteFlags for details on possible parameters.

Returns

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

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.