3 }\~@sddlmZddZddZddZdd Zd d Zd d ZddZddZ d)ddZ d*ddZ ddZ ddZ ddZddZd d!Zd"d#Zd$d%Zd+d'd(Zd&S),)ImagecCstjd|j|S)zVFill a channel with a given grey level. :rtype: :py:class:`~PIL.Image.Image` L)rnewsize)imagevaluerf/private/var/folders/pf/wv4htv3x0qs2c2mp0dnn0kchsvlck3/T/pip-install-i584jbuk/Pillow/PIL/ImageChops.pyconstantsr cCs|jS)ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`. :rtype: :py:class:`~PIL.Image.Image` )copy)rrrr duplicatesr cCs|j|j|jjS)z Invert an image (channel). .. code-block:: python out = MAX - image :rtype: :py:class:`~PIL.Image.Image` )load_newimZ chop_invert)rrrr invert's rcCs$|j|j|j|jj|jS)a Compares the two images, pixel by pixel, and returns a new image containing the lighter values. At least one of the images must have mode "1". .. code-block:: python out = max(image1, image2) :rtype: :py:class:`~PIL.Image.Image` )r rrZ chop_lighter)image1image2rrr lighter6s rcCs$|j|j|j|jj|jS)a 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 out = min(image1, image2) :rtype: :py:class:`~PIL.Image.Image` )r rrZ chop_darker)rrrrr darkerGs rcCs$|j|j|j|jj|jS)z Returns the absolute value of the pixel-by-pixel difference between the two images. At least one of the images must have mode "1". .. code-block:: python out = abs(image1 - image2) :rtype: :py:class:`~PIL.Image.Image` )r rrZchop_difference)rrrrr differenceXs rcCs$|j|j|j|jj|jS)ai 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. At least one of the images must have mode "1". .. code-block:: python out = image1 * image2 / MAX :rtype: :py:class:`~PIL.Image.Image` )r rrZ chop_multiply)rrrrr multiplyisrcCs$|j|j|j|jj|jS)z Superimposes two inverted images on top of each other. At least one of the images must have mode "1". .. code-block:: python out = MAX - ((MAX - image1) * (MAX - image2) / MAX) :rtype: :py:class:`~PIL.Image.Image` )r rrZ chop_screen)rrrrr screen}s r?cCs(|j|j|j|jj|j||S)a5 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 out = ((image1 + image2) / scale + offset) :rtype: :py:class:`~PIL.Image.Image` )r rrZchop_add)rrscaleoffsetrrr adds rcCs(|j|j|j|jj|j||S)a: 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 out = ((image1 - image2) / scale + offset) :rtype: :py:class:`~PIL.Image.Image` )r rrZ chop_subtract)rrrrrrr subtracts rcCs$|j|j|j|jj|jS)zAdd two images, without clipping the result. At least one of the images must have mode "1". .. code-block:: python out = ((image1 + image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )r rrZchop_add_modulo)rrrrr add_modulos rcCs$|j|j|j|jj|jS)zSubtract two images, without clipping the result. At least one of the images must have mode "1". .. code-block:: python out = ((image1 - image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )r rrZchop_subtract_modulo)rrrrr subtract_modulos rcCs$|j|j|j|jj|jS)zLogical AND between two images. At least one of the images must have mode "1". .. code-block:: python out = ((image1 and image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )r rrZchop_and)rrrrr logical_ands r cCs$|j|j|j|jj|jS)zLogical OR between two images. At least one of the images must have mode "1". .. code-block:: python out = ((image1 or image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )r rrZchop_or)rrrrr logical_ors r!cCs$|j|j|j|jj|jS)zLogical XOR between two images. At least one of the images must have mode "1". .. code-block:: python out = ((bool(image1) != bool(image2)) % MAX) :rtype: :py:class:`~PIL.Image.Image` )r rrZchop_xor)rrrrr logical_xors r"cCstj|||S)zBlend images using constant transparency weight. Alias for :py:meth:`PIL.Image.Image.blend`. :rtype: :py:class:`~PIL.Image.Image` )rblend)rralpharrr r#sr#cCstj|||S)zCreate composite using transparency mask. Alias for :py:meth:`PIL.Image.Image.composite`. :rtype: :py:class:`~PIL.Image.Image` )r composite)rrmaskrrr r% sr%NcCs(|dkr |}|j|j|jj||S)a~Returns a copy of the image where data has been offset by the given distances. Data wraps around the edges. If **yoffset** is omitted, it is assumed to be equal to **xoffset**. :param xoffset: The horizontal distance. :param yoffset: The vertical distance. If omitted, both distances are set to the same value. :rtype: :py:class:`~PIL.Image.Image` N)r rrr)rZxoffsetZyoffsetrrr rs r)rr)rr)N)rr r rrrrrrrrrrr r!r"r#r%rrrrr s$