B ë˜Þ]~ã@s¦ddlmZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Zdd„Z d)dd„Z d*dd„Z dd„Z dd„Z dd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd+d'd(„Zd&S),é)ÚImagecCst d|j|¡S)zVFill a channel with a given grey level. :rtype: :py:class:`~PIL.Image.Image` ÚL)rÚnewÚsize)ÚimageÚvalue©rú0/tmp/pip-build-ktz6qwqq/Pillow/PIL/ImageChops.pyÚconstantsr cCs| ¡S)ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`. :rtype: :py:class:`~PIL.Image.Image` )Úcopy)rrrr Ú duplicatesr cCs| ¡| |j ¡¡S)z… Invert an image (channel). .. code-block:: python out = MAX - image :rtype: :py:class:`~PIL.Image.Image` )ÚloadÚ_newÚimZ chop_invert)rrrr Úinvert's rcCs$| ¡| ¡| |j |j¡¡S)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)Úimage1Úimage2rrr Úlighter6s rcCs$| ¡| ¡| |j |j¡¡S)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¡¡S)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¡¡S)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¡¡S)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||¡¡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)rrÚscaleÚoffsetrrr ÚaddŽs rcCs(| ¡| ¡| |j |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 Úsubtract s rcCs$| ¡| ¡| |j |j¡¡S)zÓAdd 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_modulo²s rcCs$| ¡| ¡| |j |j¡¡S)zØSubtract 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_moduloÂs rcCs$| ¡| ¡| |j |j¡¡S)zÈLogical 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_andÒs r cCs$| ¡| ¡| |j |j¡¡S)zÆLogical 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_orâs r!cCs$| ¡| ¡| |j |j¡¡S)zÓLogical 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_xoròs r"cCst |||¡S)zBlend images using constant transparency weight. Alias for :py:meth:`PIL.Image.Image.blend`. :rtype: :py:class:`~PIL.Image.Image` )rÚblend)rrÚalpharrr r#sr#cCst |||¡S)zŒCreate composite using transparency mask. Alias for :py:meth:`PIL.Image.Image.composite`. :rtype: :py:class:`~PIL.Image.Image` )rÚ composite)rrÚmaskrrr r% sr%NcCs(|dkr |}| ¡| |j ||¡¡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$