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
Created an animated PNG from RGBA images with transparent colors (non-zero alpha).
What did you expect to happen?
The animated PNG should preserve the alpha channel of the individual images.
What actually happened?
The alpha channel of all but the first image in the sequence is discarded. If the frames are of a static object fading in or out, then PIL then thinks that all of the frames are the same, and then discards them.
This bug also seems to occur with animated GIFs, but I'm not 100% sure the root cause is the same.
What are your OS, Python and Pillow versions?
OS: macOS 13.3.1
Python: 3.11.3
Pillow: 9.5.0
This script will create an APNG from 10 frames, with the alpha of the red square in the center increasing each frame:
Thanks for the head start. Your suggestion does break some of our existing tests, but I was able to add some further changes to fix them. I've created PR #7123 to resolve this.
What did you do?
Created an animated PNG from RGBA images with transparent colors (non-zero alpha).
What did you expect to happen?
The animated PNG should preserve the alpha channel of the individual images.
What actually happened?
The alpha channel of all but the first image in the sequence is discarded. If the frames are of a static object fading in or out, then PIL then thinks that all of the frames are the same, and then discards them.
This bug also seems to occur with animated GIFs, but I'm not 100% sure the root cause is the same.
What are your OS, Python and Pillow versions?
This script will create an APNG from 10 frames, with the alpha of the red square in the center increasing each frame:
Here is the PNG file with the transparency issue:
What happened here is that when the alpha channel was thrown away, all of the images in
append_images
are exactly the same and they get thrown away.This is how I would expect the correct image to look:
The text was updated successfully, but these errors were encountered: