TODO
Previously, it was 0, for the best speed. The default has now been changed to 4, to match WebP's default, for higher quality with still some speed optimisation.
Pillow 7.0 changed the default resampling filter to Image.BICUBIC
. However, as this is not supported yet for images with a custom number of bits, the default filter for those modes has been reverted to Image.NEAREST
.
For apply()
, match()
and get_on_pixels()
, if the image mode is not L, an :pyException
was thrown. This has now been changed to a :pyValueError
.
Returns a resized version of the image, set to the maximum width and height within size
, while maintaining the original aspect ratio.
To compare it to other ImageOps methods:
- :py
~PIL.ImageOps.fit
expands an image until is fillssize
, cropping the parts of the image that do not fit. - :py
~PIL.ImageOps.pad
expands an image to fillsize
, without cropping, but instead filling the extra space withcolor
. - :py
~PIL.ImageOps.contain
is similar to :py~PIL.ImageOps.pad
, but it does not fill the extra space. Instead, the original aspect ratio is maintained. So unlike the other two methods, it is not guaranteed to return an image ofsize
.
TODO
TODO