Skip to content

TST: Convert all non-RGB(A) images to RGBA - #32212

Open
QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:compare-palette
Open

TST: Convert all non-RGB(A) images to RGBA#32212
QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:compare-palette

Conversation

@QuLogic

@QuLogic QuLogic commented Aug 15, 2026

Copy link
Copy Markdown
Member

PR summary

Sometimes, oxipng may optimize an image by making it use a palette, and converting that directly to RGB causes a warning from Pillow. In fact, it may be wrong, since there may be transparency in the palette.

Instead of checking all image formats, convert everything non-RGB(A) to RGBA first.

AI Disclosure

None

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • [n/a] Plotting related features are demonstrated in an example
  • [n/a] New features and API changes have release notes
  • [n/a] Documentation complies with general and docstring guidelines

@QuLogic QuLogic added this to the v3.11.2 milestone Aug 15, 2026
Comment thread lib/matplotlib/testing/compare.py
Sometimes, `oxipng` may optimize an image by making it use a palette,
and converting that directly to RGB causes a warning from Pillow. In
fact, it may be wrong, since there may be transparency in the palette.

Instead of checking all image formats, convert everything non-RGB(A) to
RGBA first.
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.

3 participants