镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Convert P images to RGB before comparing - #10290

Merged
radarhere merged 3 commits into
python-pillow:mainfrom
radarhere:convert_to_comparable
Oct 27, 2026
Merged

radarhere merged 3 commits into
python-pillow:mainfrom
radarhere:convert_to_comparable

Conversation

@radarhere

@radarhere radarhere commented Oct 23, 2026 •

Copy link
Copy Markdown
Member
  • When comparing pixels from two P images, it is good to convert them to RGB first, since two P images might have the same indexes in their pixel data, but different values in their palettes. Yes, I checked that they didn't have any transparency, so they didn't need to be converted to RGBA.
  • I found that when comparing I;16 images in Tests/test_file_jpeg2k.py, we can use assert_image_equal* rather than assert_image_similar*.

Once those two changes were made, convert_to_comparable() no longer did anything, so I've removed it.

@radarhere radarhere mentioned this pull request Oct 23, 2026
@radarhere
radarhere merged commit a91c634 into python-pillow:main Oct 27, 2026
50 checks passed
@radarhere
radarhere deleted the convert_to_comparable branch October 27, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant