a :jg ć@s¦ddlmZddlmZddddœdd„Zddd œd d „Zddd œd d „Zddddœdd„Zddddœdd„Zddddœdd„Z ddddœdd„Z ddddœdd„Z ddddœdd„Z ddddœdd„Z ddddœdd„Zd;ddd d dd!œd"d#„Zdé)Ś annotationsé)ŚImagez Image.ImageŚint)ŚimageŚvalueŚreturncCst d|j|”S)zVFill a channel with a given gray level. :rtype: :py:class:`~PIL.Image.Image` ŚL)rŚnewŚsize)rr©r ś8/usr/local/lib/python3.9/site-packages/PIL/ImageChops.pyŚconstantsr)rrcCs| ”S)ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`. :rtype: :py:class:`~PIL.Image.Image` )Ścopy©rr r r Ś duplicate srcCs| ”| |j ””S)zl Invert an image (channel). :: out = MAX - image :rtype: :py:class:`~PIL.Image.Image` )ŚloadŚ_newŚimZ chop_invertrr r r Śinvert)s r)Śimage1Śimage2rcCs$| ”| ”| |j |j””S)z½ Compares the two images, pixel by pixel, and returns a new image containing the lighter values. :: out = max(image1, image2) :rtype: :py:class:`~PIL.Image.Image` )rrrZ chop_lighter©rrr r r Ślighter6s rcCs$| ”| ”| |j |j””S)z¼ Compares the two images, pixel by pixel, and returns a new image containing the darker values. :: out = min(image1, image2) :rtype: :py:class:`~PIL.Image.Image` )rrrZ chop_darkerrr r r ŚdarkerEs rcCs$| ”| ”| |j |j””S)z² Returns the absolute value of the pixel-by-pixel difference between the two images. :: out = abs(image1 - image2) :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_differencerr r r Ś differenceTs rcCs$| ”| ”| |j |j””S)a 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. :: out = image1 * image2 / MAX :rtype: :py:class:`~PIL.Image.Image` )rrrZ chop_multiplyrr r r Śmultiplycs rcCs$| ”| ”| |j |j””S)zŖ Superimposes two inverted images on top of each other. :: out = MAX - ((MAX - image1) * (MAX - image2) / MAX) :rtype: :py:class:`~PIL.Image.Image` )rrrZ chop_screenrr r r Śscreents rcCs$| ”| ”| |j |j””S)z Superimposes two images on top of each other using the Soft Light algorithm :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_soft_lightrr r r Ś soft_light‚srcCs$| ”| ”| |j |j””S)z Superimposes two images on top of each other using the Hard Light algorithm :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_hard_lightrr r r Ś hard_lightŽsrcCs$| ”| ”| |j |j””S)z| Superimposes two images on top of each other using the Overlay algorithm :rtype: :py:class:`~PIL.Image.Image` )rrrZ chop_overlayrr r r Śoverlayšsr ēš?Śfloat)rrŚscaleŚoffsetrcCs(| ”| ”| |j |j||””S)zé Adds two images, dividing the result by scale and adding the offset. If omitted, scale defaults to 1.0, and offset to 0.0. :: out = ((image1 + image2) / scale + offset) :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_add©rrr#r$r r r Śadd¦s r&cCs(| ”| ”| |j |j||””S)zī Subtracts two images, dividing the result by scale and adding the offset. If omitted, scale defaults to 1.0, and offset to 0.0. :: out = ((image1 - image2) / scale + offset) :rtype: :py:class:`~PIL.Image.Image` )rrrZ chop_subtractr%r r r Śsubtract·s r'cCs$| ”| ”| |j |j””S)z‡Add two images, without clipping the result. :: out = ((image1 + image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_add_modulorr r r Ś add_moduloČsr(cCs$| ”| ”| |j |j””S)zŒSubtract two images, without clipping the result. :: out = ((image1 - image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_subtract_modulorr r r Śsubtract_moduloÕsr)cCs$| ”| ”| |j |j””S)ajLogical AND between two images. Both of the images must have mode "1". If you would like to perform a logical AND on an image with a mode other than "1", try :py:meth:`~PIL.ImageChops.multiply` instead, using a black-and-white mask as the second image. :: out = ((image1 and image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_andrr r r Ś logical_andās r*cCs$| ”| ”| |j |j””S)z¦Logical OR between two images. Both of the images must have mode "1". :: out = ((image1 or image2) % MAX) :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_orrr r r Ś logical_orōs r+cCs$| ”| ”| |j |j””S)z³Logical XOR between two images. Both of the images must have mode "1". :: out = ((bool(image1) != bool(image2)) % MAX) :rtype: :py:class:`~PIL.Image.Image` )rrrZchop_xorrr r r Ś logical_xors r,)rrŚalpharcCst |||”S)z‰Blend images using constant transparency weight. Alias for :py:func:`PIL.Image.blend`. :rtype: :py:class:`~PIL.Image.Image` )rŚblend)rrr-r r r r.sr.)rrŚmaskrcCst |||”S)z†Create composite using transparency mask. Alias for :py:func:`PIL.Image.composite`. :rtype: :py:class:`~PIL.Image.Image` )rŚ composite)rrr/r r r r0s r0Nz int | None)rŚxoffsetŚyoffsetrcCs(|dur |}| ”| |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 image: Input image. :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)rrrr$)rr1r2r r r r$(s r$)r!r)r!r)N)Ś __future__rŚrrrrrrrrrrrr r&r'r(r)r*r+r,r.r0r$r r r r Śs0        ’’