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

Transparent animated gif re-encoding and re-quantization #4

Open
lilith opened this issue Dec 4, 2024 · 1 comment
Open

Transparent animated gif re-encoding and re-quantization #4

lilith opened this issue Dec 4, 2024 · 1 comment

Comments

@lilith
Copy link

lilith commented Dec 4, 2024

For my use case in Imageflow, I want to support round-tripping transparent (background+delta) animated gifs (while doing operations like resizing/etc on them in 32-bit BGRA mode and then re-quantizing). I see a dispose_only method that mentions this case, but no examples. I'm currently migrating my custom fork of dispose/gif to use your crates, and was wondering if you have any examples of this kind of task.

@kornelski
Copy link
Owner

kornelski commented Dec 8, 2024

See gifski for example usage.

https://github.com/ImageOptim/gifski/blob/b3946398cea3999c77be50880bdc5692d53bd178/src/lib.rs#L810-L823

After dispose_only() the image is the exact canvas that the next frame will be painted on, so it can be used to find minimum difference between the canvas and the next full frame. This can be more precise than tracking of "dirty" rectangles.

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