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

Optimizing gif size using transparency ? #30

Open
tigrouind opened this issue Apr 17, 2024 · 0 comments
Open

Optimizing gif size using transparency ? #30

tigrouind opened this issue Apr 17, 2024 · 0 comments

Comments

@tigrouind
Copy link

tigrouind commented Apr 17, 2024

I wonder if it's possible to create a gif that supports transparency between frames, in order to reduce size.

foreach (var img in images)
{
         var delta = computeDifference(previousImg, img);
         previousImg = img;
         gif.AddFrame(delta);
}

The idea is to set pixels that do not change between frames as transparent.
I have tried to create such frames (setting transparent pixels to 0x00000000) but it does not work.
Frames are indeed transparent, but each frame clear the previous one.
It's probably something as simple as setting a flag per frame or for the whole animation.

It seems a requirement is to use a global palette. Local palettes per frame and transparency as explained above seems not possible.

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

1 participant