-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Exception when converting GIF to RGB and saving #2803
Comments
Right above the warning code is the following: Why is that not fixing the issue? Does the warning cause the image with the deleted transparency to not be returned and the used later? |
@hugovk Is this a bug? |
is this the same? #2704 |
I have created PR #3187 to address this, which has the effect of correctly applying |
With #3187 merged, the TypeError is now fixed. The image is now output as in the earlier comment by @hugovk. If the UserWarning 'Couldn't allocate palette entry for transparency' is accepted behaviour, then this issue is resolved. |
There's a fundamental problem with this situation. Outside of the plus symbol, color index is 255, the transparency. Inside of the plus symbol, the color index is 0. Both of those entries are (0, 0, 0) in the palette though. So once you convert to RGB, they become the same, and we're not able to get the original image back again. This is a limitation of converting P to RGB. So I think the correct output of this code should an empty plus symbol. |
#5552 resolves this. |
I've reduced the issue down to 2 lines of code:
The image with the issue:

The exception I get:
This is with Pillow 4.3.0 and Python 2.7.7
The text was updated successfully, but these errors were encountered: