Repository navigation
Improve support for TGA images in P mode with an RGBA palette - #10211
Merged
radarhere merged 3 commits intoOct 15, 2026
Merged
Conversation
Member
|
I've pushed a commit to support saving with a 32-bit colour map as well. |
radarhere
force-pushed
the
fix-tga-32bit-colormap
branch
from
October 15, 2026 21:37
5c84460 to
17f8eb8
Compare
radarhere
force-pushed
the
fix-tga-32bit-colormap
branch
from
October 15, 2026 21:38
17f8eb8 to
a60da6d
Compare
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.
Changes proposed in this pull request:
TgaImagePluginhas a branch for 32-bit colour maps, but it reads them with the "BGRA" rawmode while leaving the palette mode as "RGB". There's no RGB unpacker for BGRA, so the image opens and then fails as soon as it's loaded:The 16-bit branch right above it already sets
self.palette.mode = "RGBA", so I've done the same. The image from the new test then converts to RGBA as (255, 0, 0, 255), (0, 0, 255, 0), which is also what ffmpeg decodes from the same bytes. Noticed while reading the plugin; tests pass locally.Didn't find this reported. #5400 and #7965 dealt with 16-bit colour maps, and #8158 renames the 16-bit rawmode a few lines up but doesn't touch the 32-bit branch.