Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request - On Progress Callback #1

Open
rdsilver opened this issue Sep 1, 2023 · 1 comment
Open

Request - On Progress Callback #1

rdsilver opened this issue Sep 1, 2023 · 1 comment

Comments

@rdsilver
Copy link

rdsilver commented Sep 1, 2023

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)
})
@qq15725
Copy link
Owner

qq15725 commented Jan 11, 2024

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 ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants