Constructor
# new GIF(frames, loopCountopt)
Creates a new GIF image.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
frames |
Array.<Frame> | The frames to create the GIF from |
||
loopCount |
number |
<optional> |
-1 | How often to loop the GIF for (-1 = unlimited) |
Properties:
Name | Type | Description |
---|---|---|
loopCount |
number | How often the GIF will loop for |
Extends
- Array.<Frame>
Members
Methods
# async encode(qualityopt) → {Promise.<Uint8Array>}
Encodes the image into a GIF
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
quality |
number |
<optional> |
95 | GIF quality 0-100 |
The encoded data
Promise.<Uint8Array>
# async static decode(data, onlyExtractFirstFrameopt) → {Promise.<GIF>}
Decodes a GIF image
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
data |
Buffer | Uint8Array | The binary data to decode |
||
onlyExtractFirstFrame |
boolean |
<optional> |
false | Whether to end GIF decoding after the first frame |
The decoded GIF
Promise.<GIF>