-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
PIL doesn't seem to handle the color map correctly in some color indexed TGA files #4830
Comments
Still work in progress. Can invert all colors on RGB, RGBA and P mode of the supported formats. There is an issue with PIL which I have reported: python-pillow/Pillow#4830 Green channel inversion works too. More testing and a lot of improvements to come.
Do you have images that demonstrate this problem, that are able to be added to the test suite under the Pillow license? |
I have recreated those images which you can add to the test suite. Thank you. |
I've created #5396 to fix an unrelated bug mentioned in the StackOverflow answer. If #5400 is merged, then the following will work. from PIL import Image
Image.open('UCM8.TGA').convert("RGB").show() |
Please see my question in Stack Overflow where I explain everything in greater detail and more importantly, where Mark Setchell explains why he thinks there is a bug in PIL when handling some color indexed TGA files.
Basically, I am working with a sample color indexed TGA file to test a script that would invert its colors.
But before any of that, the issue is that PIL doesn't seem to handle the color map correctly when open it and the values of the color palette end up being wrong.
These are the sample files: CCM8.TGA and UCM8.TGA.
And you will see that if you open show any of them:
PIL shows:
When it should be:
As I said, I wrote all the details on that post. If you want me to submit more information here, please let me know.
I am using Pillow 7.0 on Fedora 32 and Python 3.8.
The text was updated successfully, but these errors were encountered: