Correct PDF palette size when saving by radarhere · Pull Request #7555 · python-pillow/Pillow
homm approved these changes Nov 16, 2023
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a third member in dict_obj["ColorSpace"] list which is 255. Isn't better to adjust it?
The maximum valid index value in the pallet (the current pallet, as I understand it). This is articulated because it's not a number or items, it's the index of the last element. "The colour table data shall be m•Y(hival +1) bytes long". So if we say that hival is 31, we can write (31+1)•3 = 96 bytes.
radarhere
changed the title
Pad PDF palette to 256 entries when saving
Correct PDF palette size when saving
homm approved these changes Dec 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters