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

Prioritise speed in _repr_png_ #7242

Merged
merged 1 commit into from Jun 30, 2023
Merged

Conversation

radarhere
Copy link
Member

Resolves #7241

When ImageShow saves an image as a PNG, it uses "compress_level" of 1

Pillow/src/PIL/ImageShow.py

Lines 177 to 178 in 1174a9e

format = "PNG"
options = {"compress_level": 1, "save_all": True}

This prioritises speed over file size, presumably because this image is intended to just be shown, not saved for later use.

That same logic would apply to _repr_png, so this PR adds "compress_level" of 1 to that functionality as well.

@hugovk hugovk merged commit bd795d7 into python-pillow:main Jun 30, 2023
53 checks passed
@radarhere radarhere deleted the repr_png branch June 30, 2023 06:14
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.

Performance of _repr_png_ with larger images
2 participants