Install
This module requires node >= 8
.
Usage
const extractFrames = ;const fs = ; { console; const buffer = fs; const results = await ; console;};
API
extractFrames(opts)
Returns: Promise<ndarray>
Returns a modified version of the ndarray returned by get-pixels.
opts.input
Type: String
Required
Path to a GIF file.
opts.type
Type: String
requried when input is a buffer value: 'image/gif' etc
opts.merge
Type: String
merge all frames into one sprite png when merge === true
opts.output
Type: String
Example: 'output/frame-%d.png'
Optional frame pattern if you want to write each frame to disk. Should contain a %d
that will be replaced with the frame number (starting at 0).
The resulting ndarray will be returned whether or not an output
is given.
opts.coalesce
Type: Boolean
Default: true
Whether or not to perform inter-frame coalescing.