Andrew Murray

Results 765 comments of Andrew Murray

A final note - when I wrote `im.convert("P")` above, `im.convert("P", palette=Image.Palette.ADAPTIVE)` would have been better.

`ADAPTIVE` creates a palette from the image, in combination with the `colors` argument. From experience, `WEB` creates a static palette, regardless of the image. ```python >>> from PIL import Image...

The decision to use `quantize` for RGBA to P conversion was made in #574. Although I've realised that [RGB to P conversion with an ADAPTIVE palette also quantizes](https://github.com/python-pillow/Pillow/blob/f5c47ebe128a448ada4e0330005e580e1ea0ab95/src/PIL/Image.py#L1043-L1044), and that...

For next time, I think a new issue would be better, as your primary question is around file size, which the rest of this issue is not concerned with. The...

I've created #7568 as a possible improvement to the file size concerns from @Nydeyas. With that PR, the file created is actually smaller than the original image.

Note that this is a duplicate of #3041

> I encountered this issue as well not very long ago. Is there any workaround in the meantime to "force" reading as `I;16`? Because Pillow doesn't scale images during conversion...

Individual plugins set the modes that images are opened in. If you're asking why the code is behaving this why, it is because of https://github.com/python-pillow/Pillow/blob/2bd54260b614e3303f0f3b7d9586a011418c1f91/src/PIL/PngImagePlugin.py#L65

I've created PR #7849 to resolve this.