modern-gif
modern-gif copied to clipboard
Request - On Progress Callback
It would be excellent if there was an optional onProgress callback that would return the current frame being processed. That way you could give the users an idea of how long the gif will take to make.
const output = await encode({
width: 200, height: 200,
frames: [
{ imageData: '/example1.png', delay: 100 },
{ imageData: '/example2.png', delay: 100 }
],
onProgress: (frame) => console.log(frame)
})
In fact, all frames need to be sampled first to generate a palette (the same palette as ffmpeg), then each frame is matched from the palette to index, crop, and encode to gif
So progress callback, I also do not know how to provide ~