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
pdf: Use explicit palette when saving indexed images
Asking Pillow for an "adaptive palette" does not appear to guarantee
that the chosen colours will be the same, even if asking for exactly the
same number as exist in the image. Instead, create an explicit palette,
and quantize using it.
Additionally, since now the palette may be smaller than 256 colours,
Pillow may choose to encode the image data with fewer than 8 bits per
component, so we need to properly reflect that in the decode parameters
(this was already done for the image parameters).
The effect on test images with _many_ colours is small, with a maximum
RMS of 1.024, but for images with few colours, the result can be
completely wrong as in the reported #25806.
0 commit comments