Repository navigation
Scale tRNS grey level for 2-bit and 4-bit grayscale PNGs - #10320
LemonCondor wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Muguett-DBY
left a comment
There was a problem hiding this comment.
I checked the intermediate gray levels too: generated 2-bit and 4-bit grayscale PNGs containing every sample value, then used each possible value as the transparency key. All 20 cases produced the expected luminance and alpha, including black and intermediate values.
This used the exact chunk_tRNS method from d8fff8f with the existing Pillow 12.3 decoder on Windows; I did not build the branch or run its full test suite.
|
Do you have an image that you found in the wild that demonstrates this? It would be helpful to have one for the record. |
|
Yes, PngSuite's With Pillow 13.0.0 it opens as mode PngSuite's licence allows redistribution, so I can add the file to |
Changes proposed in this pull request:
L, soinfo["transparency"]never matched any pixel and transparency was lost onconvert("LA"). Mode1was already scaled.bits=still read back as 255.