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
i'm trying to resize a GIF, unpacking every single frame i had no issue, they all have the correct transparent background, but when i try to create/save the GIF only the first frame will have the correct transparency, the other ones will have black background.
i iterate backwards because thumbnail will raise an error if i iterate normaly after one cicle(i think is because im.size pick the first frame for reference)
imput image :
those are the single frame my code produced:
output:
I tried to include background= (0, 0, 0, 0) but getcolor in ImagePalette.py will raise an ValueError: cannot add non-opaque RGBA color to RGB palette
upon further inspection using print(im_temp.info) before inserting the fram i got this result in console
As an explanation, by default, GifImagePlugin does try to detect the transparency in your images, but after it is converted to P, the first pixel is (0, 0, 0, 1) - translucent, rather than transparent, which we can't express in a GIF.
If the default behaviour was to be improved here, it would be a conversion problem.
i'm trying to resize a GIF, unpacking every single frame i had no issue, they all have the correct transparent background, but when i try to create/save the GIF only the first frame will have the correct transparency, the other ones will have black background.
i iterate backwards because thumbnail will raise an error if i iterate normaly after one cicle(i think is because im.size pick the first frame for reference)
imput image :
those are the single frame my code produced:
output:
I tried to include background= (0, 0, 0, 0) but getcolor in ImagePalette.py will raise an
ValueError: cannot add non-opaque RGBA color to RGB palette
upon further inspection using
print(im_temp.info)
before inserting the fram i got this result in consoleit may be related to transparency attribute?
The text was updated successfully, but these errors were encountered: