Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unnecessary values #5884

Closed
wants to merge 1 commit into from
Closed

unnecessary values #5884

wants to merge 1 commit into from

Conversation

kero-ly
Copy link

@kero-ly kero-ly commented Dec 13, 2021

Fixes #5877 .

Changes proposed in this pull request:
Pillow is saving all 256 colors in palette even if only 2 colors are defined thus increasing the size of the pngs significantly.
We use paletted pngs to save space and bandwidth but we have to manually remove palette from all pngs saved by Pillow. (In old version we would simply remove img.palette.palette altogether and png would be saved properly. In new versions it's no longer possible so we have to cut it to correct size)
Python code provided should show exact way how palettes are being increased in size by this issue.
*
*
*

@hugovk
Copy link
Member

hugovk commented Dec 13, 2021

Closing: this is a duplicate of PR #5879, but without tests.

@hugovk hugovk closed this Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pillow is saving unnecessary values in paletted pngs
2 participants