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
Reading GIF frame-by-frame changes mode during read in Pillow 9 #5929
Comments
I presume there is a contingent of Pillow users who just read the first frame of images, and don't bother seeking past that. #5857 had no effect on those users. For Pillow users who do read animated GIFs, I expect them to be ok with this change, in the face of being able to read many GIF images correctly for the first time. This is just a judgement call, but for my part, I'm a bit reluctant to change the experience of the first group of users for something that isn't an error. P mode more accurately reflects what is in that first image. |
I, too, like the idea behind this change, because it means better support for GIFs that use a different palette for each image and try to be smart on what areas they do/don't dispose of. I'm not sure I agree on the part where P is the more accurate mode for the first image, though. RGB/RGBA seems to be more desirable for subsequent images (hence the change), and I don't see what makes the first page special to warrant an exception. Then again, you probably have a better view of the broader context, and it might indeed be the better choice. To me, this behavior was/is still quite surprising and a bit unexpected, which is why I opened this issue to ask if it is worthwhile to change it. Since you don't seem to think that it is worthwhile to change this behavior, I will go ahead and close this issue and look into changes downstream to adjust for the new pillow behavior. |
I encountered some new behavior in pillow v9 that - to me - is a bit counter-intuitive (image attached):
Technically, this is not a bug, since it seems to be intended behavior according to the v9 changelog. At the same time, I find it a bit counter-intuitive that the first frame of a GIF now has mode
P
while each subsequent frame has modeRGB
/RGBA
.I was wondering if it would be possible to make this more consistent and also convert the first frame (
img.seek(0)
) of any GIF to RGB/RGBA, so that the mode of all frames is consistent.Supplementary:
The text was updated successfully, but these errors were encountered: