Skip to content

imreadanimation

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

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

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

example: samples/cpp/tutorial_code/imgcodecs/animations.cpp An example to show usage of cv::imreadanimation and cv::imwriteanimation functions. Check tutorial_animations "the corresponding tutorial" for more details Loads frames from an animated image file into an Animation structure.

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

imreadanimation(filename: EmbindString, animation: Animation, start: number, count: number): boolean;
3 available overloads
imreadanimation(filename: EmbindString, animation: Animation): boolean;
imreadanimation(filename: EmbindString, animation: Animation, start: number): boolean;
imreadanimation(filename: EmbindString, animation: Animation, start: number, count: number): boolean;
filename

A string containing the path to the file.

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