You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an image which mode is P and this image has a specific palette. So when you do pad for this image it will return an image that is displayed as completely black.
So this is origin image
And this image is after applying ImageOps.pad
This images all have the same unique values of pixels - (array([0, 1, 2, 3, 4, 5], dtype=uint8), array([0, 1, 2, 3, 4, 5], dtype=uint8))
But when convert origin and pad image to rgb it will have different uniq value - (array([0, 1, 2, 3, 4, 5], dtype=uint8), array([ 0, 13, 35, 80, 83, 98, 148, 150, 171, 177, 212, 227, 255], dtype=uint8))
What did you do?
Download spidy image. It is image with mode P and has a specific palette. Read this image via Pillow then use ImageOps.pad and you will see full black image.
What did you expect to happen?
I expect to see pad colorful spidy image.
What actually happened?
In pad palette of origin image don't copy, so you see full black image after padding.
I think i found a bug with
ImageOps.pad
function.I have an image which mode is
P
and this image has a specific palette. So when you do pad for this image it will return an image that is displayed as completely black.So this is origin image
![spidy](https://user-images.githubusercontent.com/41536639/190923282-05d98c8f-a6b0-43c9-9101-2db756a56a17.png)
And this image is after applying
![pad_spidy](https://user-images.githubusercontent.com/41536639/190923554-f76f77e1-26d2-48a2-b754-af9668c0639f.png)
ImageOps.pad
This images all have the same unique values of pixels -
(array([0, 1, 2, 3, 4, 5], dtype=uint8), array([0, 1, 2, 3, 4, 5], dtype=uint8))
But when convert origin and pad image to rgb it will have different uniq value -
(array([0, 1, 2, 3, 4, 5], dtype=uint8), array([ 0, 13, 35, 80, 83, 98, 148, 150, 171, 177, 212, 227, 255], dtype=uint8))
What did you do?
Download spidy image. It is image with mode
P
and has a specific palette. Read this image via Pillow then useImageOps.pad
and you will see full black image.What did you expect to happen?
I expect to see pad colorful spidy image.
What actually happened?
In pad palette of origin image don't copy, so you see full black image after padding.
What are your OS, Python and Pillow versions?
Reproduce code:
The text was updated successfully, but these errors were encountered: