You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When encoding a GIF, it gives me additional delay for each frame of the GIF. This is noticeable for GIFs with high FPS. It seems to be fine for GIFs around 60 FPS, but the delay is noticeable for GIFs above 120 frames. As you can see below, the circle moves slower due to the additional delay.
Before:
After:
Repro
OS: Windows 10
Node Version: v12.13.1
Dependencies:
constfs=require('fs');const{ createCanvas, loadImage, createImageData }=require('canvas');constGIFEncoder=require('gif-encoder-2');constgifFrames=require('gif-frames');// https://github.com/benwiley4000/gif-framesasyncfunctiongetGif(){// I used gifFrames to get the image buffer arrayconstimageBufferArray=gifFrames({url: gifBackgroundPath,frames: "all",cumulative: true}).map(data=>data.getImage()._obj)constencoder=newGIFEncoder(600,600,'octree',true);encoder.start();for(leti=0;i<frameDataArray.length;i+=1){constimage=awaitloadImage(imageArray[i]);constcanvas=createCanvas(600,600);constcontext=canvas.getContext("2d");context.drawImage(image,0,0);encoder.addFrame(context);}encoder.finish();constgifBuffer=encoder.out.getData();returnfs.writeFile('output.gif',gifBuffer,(err)=>{console.log(err)});}getGif().then(()=>console.log("Done!"));
The text was updated successfully, but these errors were encountered:
Description
When encoding a GIF, it gives me additional delay for each frame of the GIF. This is noticeable for GIFs with high FPS. It seems to be fine for GIFs around 60 FPS, but the delay is noticeable for GIFs above 120 frames. As you can see below, the circle moves slower due to the additional delay.
Before:
After:
Repro
OS: Windows 10
Node Version:
v12.13.1
Dependencies:
Code snippet to reproduce the bug.
The text was updated successfully, but these errors were encountered: