Improved reading 16-bit TGA images with colour#7965
Merged
hugovk merged 7 commits intopython-pillow:mainfrom Jun 28, 2024
Merged
Improved reading 16-bit TGA images with colour#7965hugovk merged 7 commits intopython-pillow:mainfrom
hugovk merged 7 commits intopython-pillow:mainfrom
Conversation
Contributor
Author
|
Actually, I missed it; "BGRA;15" is supported. |
radarhere
reviewed
Apr 11, 2024
Member
|
While the test suite now passes, if you actually run with Image.open("Tests/images/p_16.tga") as im:
im.save("out.png")you get a transparent image. Looking at 'Color Map Specification' in https://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf, it says
I think setting the 16th bit to 0 actually means it is opaque, not transparent like Pillow is used to. I've created Yay295#20 to fix this. I've also updated the tests to compare with RGBA images to prevent this problem from slipping by again. |
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
radarhere
reviewed
Jun 25, 2024
radarhere
approved these changes
Jun 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Looks like a typo in the mode name. The only other place "BGR;5" is used is in
Unpack.cwhere it's an alias for "BGR;15".The documentation I found says that it should actually be "BGRA;16" though, which isn't a mode we support.