mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 02:36:17 +03:00
Added demonstration images to docs
This commit is contained in:
parent
80dbd3b193
commit
08c69ba7f5
BIN
docs/example/imageops_contain.png
Normal file
BIN
docs/example/imageops_contain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
BIN
docs/example/imageops_cover.png
Normal file
BIN
docs/example/imageops_cover.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
BIN
docs/example/imageops_fit.png
Normal file
BIN
docs/example/imageops_fit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
BIN
docs/example/imageops_pad.png
Normal file
BIN
docs/example/imageops_pad.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
|
@ -12,15 +12,11 @@ only work on L and RGB images.
|
||||||
|
|
||||||
.. autofunction:: autocontrast
|
.. autofunction:: autocontrast
|
||||||
.. autofunction:: colorize
|
.. autofunction:: colorize
|
||||||
.. autofunction:: contain
|
|
||||||
.. autofunction:: cover
|
|
||||||
.. autofunction:: pad
|
|
||||||
.. autofunction:: crop
|
.. autofunction:: crop
|
||||||
.. autofunction:: scale
|
.. autofunction:: scale
|
||||||
.. autofunction:: deform
|
.. autofunction:: deform
|
||||||
.. autofunction:: equalize
|
.. autofunction:: equalize
|
||||||
.. autofunction:: expand
|
.. autofunction:: expand
|
||||||
.. autofunction:: fit
|
|
||||||
.. autofunction:: flip
|
.. autofunction:: flip
|
||||||
.. autofunction:: grayscale
|
.. autofunction:: grayscale
|
||||||
.. autofunction:: invert
|
.. autofunction:: invert
|
||||||
|
@ -28,3 +24,29 @@ only work on L and RGB images.
|
||||||
.. autofunction:: posterize
|
.. autofunction:: posterize
|
||||||
.. autofunction:: solarize
|
.. autofunction:: solarize
|
||||||
.. autofunction:: exif_transpose
|
.. autofunction:: exif_transpose
|
||||||
|
|
||||||
|
Resize relative to a given size
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
from PIL import Image, ImageOps
|
||||||
|
size = (100, 150)
|
||||||
|
with Image.open("Tests/images/hopper.png") as im:
|
||||||
|
ImageOps.contain(im, size).save("imageops_contain.png")
|
||||||
|
ImageOps.cover(im, size).save("imageops_cover.png")
|
||||||
|
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 |
|
||||||
|
+------+------------+-------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
|
||||||
|
.. autofunction:: contain
|
||||||
|
.. autofunction:: cover
|
||||||
|
.. autofunction:: fit
|
||||||
|
.. autofunction:: pad
|
||||||
|
|
Loading…
Reference in New Issue
Block a user