Andrew Murray
Andrew Murray
It has been revealed that GIMP palette files can contain more than 256 colors, and [requested that we read all of those colors, even though would make for an invalid...
> However, I'm not sure if the spirit of #515 is against the idea of reading an unlimited amount of data from a file. Finishing my thought, I've realised that...
> I got an idea: what about instead of adding an arg to . ' getpalette' just set the maximum number of colors in a class attribute? sounds simple, and...
#6649 has now been fixed in main.
> After Pillow 10 the deprecated fill parameter will be replaced by a direct call to the internal function. This has now been done in #7059
> the only Python function to be called between the two C functions is the decompression bomb check. If this was moved into C, the two functions could be combined...
For your first example, the problem would be that after your first frame, Pillow changes the mode of the image to RGB. This is because there may be more colours...
For your second example, When [converting from RGBA to P, `quantize` is used](https://github.com/python-pillow/Pillow/blob/2755e0ffaadc8b29c3e67e223c333c50e197a733/src/PIL/Image.py#L964-L965). It isn't when converting from RGB to P. > I added this additional step of pasting each...
Ah, ok. The point of ```python from PIL import GifImagePlugin GifImagePlugin.LOADING_STRATEGY = GifImagePlugin.LoadingStrategy.RGB_AFTER_DIFFERENT_PALETTE_ONLY ``` was precisely to stop the image frames from becoming RGB. So the fact that you're manually...
You're running `convertToP()`, but not using the result. Replace ```python for frame in ExportFrames: print(ExportFrames.index(frame)) frame=convertToP(frame) ``` with ```python for i, frame in enumerate(ExportFrames): print(ExportFrames.index(frame)) ExportFrames[i]=convertToP(frame) ```