Merge pull request #3522 from radarhere/imagechops

Improved ImageChops documentation
This commit is contained in:
Hugo 2019-01-01 12:21:28 +02:00 committed by GitHub
commit 398d2f0c15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 13 deletions

View File

@ -34,6 +34,7 @@ operations in this module).
.. autofunction:: PIL.ImageChops.lighter
.. autofunction:: PIL.ImageChops.logical_and
.. autofunction:: PIL.ImageChops.logical_or
.. autofunction:: PIL.ImageChops.logical_xor
.. autofunction:: PIL.ImageChops.multiply
.. py:method:: PIL.ImageChops.offset(image, xoffset, yoffset=None)

View File

@ -54,7 +54,7 @@ def invert(image):
def lighter(image1, image2):
"""
Compares the two images, pixel by pixel, and returns a new image containing
the lighter values.
the lighter values. At least one of the images must have mode "1".
.. code-block:: python
@ -70,8 +70,8 @@ def lighter(image1, image2):
def darker(image1, image2):
"""
Compares the two images, pixel by pixel, and returns a new image
containing the darker values.
Compares the two images, pixel by pixel, and returns a new image containing
the darker values. At least one of the images must have mode "1".
.. code-block:: python
@ -88,7 +88,7 @@ def darker(image1, image2):
def difference(image1, image2):
"""
Returns the absolute value of the pixel-by-pixel difference between the two
images.
images. At least one of the images must have mode "1".
.. code-block:: python
@ -107,7 +107,8 @@ def multiply(image1, image2):
Superimposes two images on top of each other.
If you multiply an image with a solid black image, the result is black. If
you multiply with a solid white image, the image is unaffected.
you multiply with a solid white image, the image is unaffected. At least
one of the images must have mode "1".
.. code-block:: python
@ -123,7 +124,8 @@ def multiply(image1, image2):
def screen(image1, image2):
"""
Superimposes two inverted images on top of each other.
Superimposes two inverted images on top of each other. At least one of the
images must have mode "1".
.. code-block:: python
@ -141,6 +143,7 @@ def add(image1, image2, scale=1.0, offset=0):
"""
Adds two images, dividing the result by scale and adding the
offset. If omitted, scale defaults to 1.0, and offset to 0.0.
At least one of the images must have mode "1".
.. code-block:: python
@ -156,8 +159,9 @@ def add(image1, image2, scale=1.0, offset=0):
def subtract(image1, image2, scale=1.0, offset=0):
"""
Subtracts two images, dividing the result by scale and adding the
offset. If omitted, scale defaults to 1.0, and offset to 0.0.
Subtracts two images, dividing the result by scale and adding the offset.
If omitted, scale defaults to 1.0, and offset to 0.0. At least one of the
images must have mode "1".
.. code-block:: python
@ -172,7 +176,8 @@ def subtract(image1, image2, scale=1.0, offset=0):
def add_modulo(image1, image2):
"""Add two images, without clipping the result.
"""Add two images, without clipping the result. At least one of the images
must have mode "1".
.. code-block:: python
@ -187,7 +192,8 @@ def add_modulo(image1, image2):
def subtract_modulo(image1, image2):
"""Subtract two images, without clipping the result.
"""Subtract two images, without clipping the result. At least one of the
images must have mode "1".
.. code-block:: python
@ -202,7 +208,8 @@ def subtract_modulo(image1, image2):
def logical_and(image1, image2):
"""Logical AND between two images.
"""Logical AND between two images. At least one of the images must have
mode "1".
.. code-block:: python
@ -217,7 +224,8 @@ def logical_and(image1, image2):
def logical_or(image1, image2):
"""Logical OR between two images.
"""Logical OR between two images. At least one of the images must have
mode "1".
.. code-block:: python
@ -232,7 +240,8 @@ def logical_or(image1, image2):
def logical_xor(image1, image2):
"""Logical XOR between two images.
"""Logical XOR between two images. At least one of the images must have
mode "1".
.. code-block:: python