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
How to read a true color GIF image #3473
Comments
The documentation states that 'GIF files are always read as grayscale (L) or palette mode (P) images.'. So the mode difference isn't an unintended bug. |
Is there no way to read it RGB or RGBA? |
The linked image is no longer available. |
hi, sorry image uploaded just now to https://cassiopeia.hk/etc/rob64.gif |
#5333 fixed the colours - the second frame is now correct. Testing, I find that GIMP thinks that any GIF with one frame is 'Indexed', and any GIF with more than one frame is RGB. This is understandable. While a single frame of a GIF image can only have up to 256 colors, multiple GIF frames potentially means multiple palettes, and so more than 256 colors. So I don't believe that your GIF is special in some way. Reading all of the colors from multiple frames in a GIF will, I think, ultimately involve changing the image mode to RGB (#3735). However, the image that you've supplied is now read correctly. Let us know if you have any further comments. |
If you would like the image to become RGB/RGBA, you can use the |
What did you do?
i'm trying to read frames in an RGB GIF image (not standard 8 bit palette)
What did you expect to happen?
reading frames of a standard indexed GIF image returns the original colours, works fine
What actually happened?
with my RGB GIF file, the colours go to black and white only, and the image.mode reports 'P' even when i can see in gimp that the image is RGB (not indexed colours)
What are your OS, Python and Pillow versions?
the image i'm using is at https://drive.google.com/file/d/1WEp8cuXAY_rAOE5E3tHm5zOBfJdWLn67/view?usp=sharing
sorry i'm not familiar enough with python/pillow to troubleshoot this by myself; is there any way to handle this kind of image?
The text was updated successfully, but these errors were encountered: