Allow fewer PNG palette entries than the bit depth maximum when saving #5330
Currently when saving a PNG in P mode, Pillow sets the number of bytes in the palette at two to the power of the bit depth, times 3 for the colors.
As pointed out in the issue, https://www.w3.org/TR/PNG/#11PLTE states that
So this PR changes
The length of the tRNS chunk is also changed, as https://www.w3.org/TR/PNG/#11tRNS
The text was updated successfully, but these errors were encountered: