Skip to content

Do not clip I;16 values when comparing APNG frames - #10336

Merged
radarhere merged 7 commits into
python-pillow:mainfrom
lazerg:fix/issue-10329-apng-i16-frames
Oct 28, 2026
Merged

radarhere merged 7 commits into
python-pillow:mainfrom
lazerg:fix/issue-10329-apng-i16-frames

Conversation

@lazerg

@lazerg lazerg commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #10329

When saving an I;16 APNG, frames were compared after converting to RGBA, which clips everything above 255. So frames that only differed above 255 were merged, or had their changed region cropped too small. For I;16 and I;16B, the raw pixel bytes are now compared as well.

@lazerg

lazerg commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

The Benchmark and debian-13-trixie-x86 failures also happen on main, so my change does not cause them.

@radarhere

Copy link
Copy Markdown
Member

I've created lazerg#9 with a suggestion.

@lazerg

lazerg commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, I merged it. I also added duration=100 back to the test in a6b4d8a, because without it the frames are never combined and the test passes on main too.

@radarhere
radarhere enabled auto-merge (squash) October 28, 2026 02:19
@radarhere
radarhere merged commit 2946b9c into python-pillow:main Oct 28, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APNG save_all merges or crops I;16 frames that differ only above 255

2 participants