Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Improved palette handling in ImageOps

Open PososikTeam opened this issue 3 years ago • 1 comments

Resolves #6595

This pull request fix ImageOps.pad method. In previous version of this method it doesn't copy the palette, and whats why it might change the image to full black image.

Changes proposed in this pull request:

  • Add copy origin image palette to pad image.

PososikTeam avatar Sep 18 '22 19:09 PososikTeam

https://github.com/PososikTeam/Pillow/pull/1 has been merged, containing suggestions from me

  • Removing the copy() operation, as it is not necessary, and not all images have palettes
  • Switched to using getpalette() in both pad() and expand(), allowing the test I added to pass
  • Stop expand() from only copying the palette for P images, allowing for the PA mode as well

radarhere avatar Sep 20 '22 00:09 radarhere