-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 contain() #5417
Added ImageOps contain() #5417
Conversation
3.10-dev failures seem to be due to pytest-dev/pytest#8539, which has been resolved, but is not available in a pytest release yet. |
Looks great, exactly what I was looking for. |
Sorry, I left a bunch of comments that I quickly deleted, since I had made an error. I was using a super old version of Pillow using Python2 but Python3 was fine. Seems like ImageOps.pad was always broken on Python2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also include this in the docs (autofunction
in docs/reference/ImageOps.rst
?) and release notes.
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Thank you! |
🥳 |
Oh one last comment, just realized this function is similar to Image.thumbnail except it will upscale the image, if needed. Also, for upscaling low resolution text, EDIT: nvm, just tested, NEAREST looks terrible for my use case haha. |
Resolves #5415
Adds a
contain()
method to ImageOps. I would describe it as the inverse offit()
.Running this code for each method in turn for comparison -