Pillow
Pillow copied to clipboard
Improved palette handling in ImageOps
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.
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 bothpad()andexpand(), allowing the test I added to pass - Stop
expand()from only copying the palette for P images, allowing for the PA mode as well