mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Include given size in table
This commit is contained in:
parent
40d11fa9ac
commit
1c5eab718f
|
@ -287,15 +287,17 @@ choose to resize relative to a given size.
|
|||
# thumbnail() can also be used,
|
||||
# but will modify the image object in place
|
||||
im.thumbnail(size)
|
||||
im.save("imageops_pad.png")
|
||||
im.save("imageops_thumbnail.png")
|
||||
|
||||
+------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
| | :py:meth:`~PIL.Image.Image.thumbnail` | :py:meth:`~PIL.ImageOps.contain` | :py:meth:`~PIL.ImageOps.cover` | :py:meth:`~PIL.ImageOps.fit` | :py:meth:`~PIL.ImageOps.pad` |
|
||||
+======+===========================================+============================================+==========================================+========================================+========================================+
|
||||
|Size | (100, 100) | (100, 100) | (150, 150) | (150, 100) | (150, 100) |
|
||||
+------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|Image | .. image:: ../example/image_thumbnail.png | .. image:: ../example/imageops_contain.png | .. image:: ../example/imageops_cover.png | .. image:: ../example/imageops_fit.png | .. image:: ../example/imageops_pad.png |
|
||||
+------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
| | :py:meth:`~PIL.Image.Image.thumbnail` | :py:meth:`~PIL.ImageOps.contain` | :py:meth:`~PIL.ImageOps.cover` | :py:meth:`~PIL.ImageOps.fit` | :py:meth:`~PIL.ImageOps.pad` |
|
||||
+================+===========================================+============================================+==========================================+========================================+========================================+
|
||||
|Given size | ``(150, 100)`` | ``(150, 100)`` | ``(150, 150)`` | ``(150, 100)`` | ``(150, 100)`` |
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|Resulting image | .. image:: ../example/image_thumbnail.png | .. image:: ../example/imageops_contain.png | .. image:: ../example/imageops_cover.png | .. image:: ../example/imageops_fit.png | .. image:: ../example/imageops_pad.png |
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|Resulting size | ``100×100`` | ``100×100`` | ``150×150`` | ``150×100`` | ``150×100`` |
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|
||||
.. _color-transforms:
|
||||
|
||||
|
|
|
@ -43,15 +43,17 @@ Resize relative to a given size
|
|||
# thumbnail() can also be used,
|
||||
# but will modify the image object in place
|
||||
im.thumbnail(size)
|
||||
im.save("imageops_pad.png")
|
||||
im.save("imageops_thumbnail.png")
|
||||
|
||||
+------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
| | :py:meth:`~PIL.Image.Image.thumbnail` | :meth:`contain` | :meth:`cover` | :meth:`fit` | :meth:`pad` |
|
||||
+======+===========================================+============================================+==========================================+========================================+========================================+
|
||||
|Size | (100, 100) | (100, 100) | (150, 150) | (150, 100) | (150, 100) |
|
||||
+------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|Image | .. image:: ../example/image_thumbnail.png | .. image:: ../example/imageops_contain.png | .. image:: ../example/imageops_cover.png | .. image:: ../example/imageops_fit.png | .. image:: ../example/imageops_pad.png |
|
||||
+------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
| | :py:meth:`~PIL.Image.Image.thumbnail` | :py:meth:`~PIL.ImageOps.contain` | :py:meth:`~PIL.ImageOps.cover` | :py:meth:`~PIL.ImageOps.fit` | :py:meth:`~PIL.ImageOps.pad` |
|
||||
+================+===========================================+============================================+==========================================+========================================+========================================+
|
||||
|Given size | ``(150, 100)`` | ``(150, 100)`` | ``(150, 150)`` | ``(150, 100)`` | ``(150, 100)`` |
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|Resulting image | .. image:: ../example/image_thumbnail.png | .. image:: ../example/imageops_contain.png | .. image:: ../example/imageops_cover.png | .. image:: ../example/imageops_fit.png | .. image:: ../example/imageops_pad.png |
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|Resulting size | ``100×100`` | ``100×100`` | ``150×150`` | ``150×100`` | ``150×100`` |
|
||||
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|
||||
.. autofunction:: contain
|
||||
.. autofunction:: cover
|
||||
|
|
Loading…
Reference in New Issue
Block a user