Skip to content

imdecodeanimation

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

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

ARGUMENTSbuf, animation, start, count
FUNCTIONimdecodeanimation
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Loads frames from an animated image buffer into an Animation structure.

The function imdecodeanimation loads frames from an animated image buffer (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.

imdecodeanimation(buf: Mat, animation: Animation, start: number, count: number): boolean;
3 available overloads
imdecodeanimation(buf: Mat, animation: Animation): boolean;
imdecodeanimation(buf: Mat, animation: Animation, start: number): boolean;
imdecodeanimation(buf: Mat, animation: Animation, start: number, count: number): boolean;
buf

A reference to an InputArray containing the image buffer.

animation

Output destination, filled by the native operation. A reference to an Animation structure where the loaded frames will be stored. It should be initialized before the function is called.

start

The index of the first frame to load. This is optional and defaults to 0.

count

The number of frames to load. This is optional and defaults to 32767.

Returns

Returns true if the buffer was successfully loaded and frames were extracted; 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.