mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 13:14:27 +03:00
Added thumbnail() demonstration image
This commit is contained in:
parent
ac9d8180a3
commit
ac86175491
BIN
docs/example/image_thumbnail.png
Normal file
BIN
docs/example/image_thumbnail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
|
@ -40,13 +40,18 @@ Resize relative to a given size
|
|||
ImageOps.fit(im, size).save("imageops_fit.png")
|
||||
ImageOps.pad(im, size, color="#f00").save("imageops_pad.png")
|
||||
|
||||
+------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
| | :meth:`contain` | :meth:`cover` | :meth:`fit` | :meth:`pad` |
|
||||
+======+============================================+==========================================+========================================+========================================+
|
||||
|Size | (100, 100) | (150, 150) | (150, 100) | (150, 100) |
|
||||
+------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|Image | .. image:: ../example/imageops_contain.png | .. image:: ../example/imageops_cover.png | .. image:: ../example/imageops_fit.png | .. image:: ../example/imageops_pad.png |
|
||||
+------+------------+-------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
# thumbnail() can also be used,
|
||||
# but will modify the image object in place
|
||||
im.thumbnail(size)
|
||||
im.save("imageops_pad.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 |
|
||||
+------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||
|
||||
.. autofunction:: contain
|
||||
.. autofunction:: cover
|
||||
|
|
Loading…
Reference in New Issue
Block a user