Infinite size #8152
Answered
by
Yay295
ekouidinovv
asked this question in
Q&A
Infinite size
#8152
-
I want to resize image and I don't actually care about one of the dimensions(I want my image to be upscaled if it is less than target), I tried to set it as
code example: resize = (resolution_w, sys.maxsize) if orig_w < orig_h else (sys.maxsize, resolution_h)
orig_image = orig_image.resize(resize, Image.LANCZOS) Is there any way to set one of the dimensions to be infinitely large? |
Beta Was this translation helpful? Give feedback.
Answered by
Yay295
Jun 19, 2024
Replies: 1 comment 2 replies
-
You should use one of these ImageOps methods: https://pillow.readthedocs.io/en/stable/reference/ImageOps.html#resize-relative-to-a-given-size |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ekouidinovv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should use one of these ImageOps methods: https://pillow.readthedocs.io/en/stable/reference/ImageOps.html#resize-relative-to-a-given-size