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

Added ImageOps cover method #7412

Merged
merged 9 commits into from Oct 13, 2023
Merged

Added ImageOps cover method #7412

merged 9 commits into from Oct 13, 2023

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Sep 21, 2023

Resolves #7411

Adds a cover() method to ImageOps. This is like fit(), except without cropping.

Running this code for similar ImageOps methods in turn for comparison -

from PIL import Image, ImageOps
im = Image.open("Tests/images/hopper.png")
ImageOps.cover(im, (200, 300))
Cover Fit Pad Contain
Final Size 300 x 300 200 x 300 200 x 300 200 x 200
Image cover fit pad contain

@hugovk
Copy link
Member

hugovk commented Sep 26, 2023

Thanks, let's add this to the release notes.

It would be good to have an overview in docs showing an original image how these different methods behave on example images. Perhaps like the above with a different background colour so it shows up for both dark and light themes?

@hugovk
Copy link
Member

hugovk commented Sep 27, 2023

Thanks!

Please could you link the release notes entry to the comparison, and add thumbnail to the comparison?

And I think the comparison would fit well in https://pillow--7412.org.readthedocs.build/en/7412/handbook/tutorial.html

docs/reference/ImageOps.rst Outdated Show resolved Hide resolved
@hugovk hugovk added the automerge Automatically merge PRs that are ready label Oct 13, 2023
@mergify mergify bot merged commit a4bc714 into python-pillow:main Oct 13, 2023
54 checks passed
@radarhere radarhere deleted the cover branch October 13, 2023 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PRs that are ready Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function to downscale to minimum size
3 participants