Files
intellecton/venv/lib/python3.12/site-packages/PIL/__pycache__/ImageChops.cpython-312.pyc
T

161 lines
11 KiB
Plaintext
Raw Normal View History

Ë
ß¼j
ãóddlmZddlmZddZddZddZddZddZdd „Z dd
Z
dd Z dd Z dd
Z
ddZ d ddZ d ddZddZddZddZddZddZddZ d dZd!d"dZy)#é)Ú annotationsé)ÚImagecóDtjd|j|«S)zVFill a channel with a given gray level.
:rtype: :py:class:`~PIL.Image.Image`
ÚL)rÚnewÚsize)ÚimageÚvalues úQ/home/antigravity/intellecton/venv/lib/python3.12/site-packages/PIL/ImageChops.pyÚconstantr
sô 9‰9S˜%Ÿ*™*  có"|j«S)ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`.
:rtype: :py:class:`~PIL.Image.Image`
)Úcopy©r
s r Ú duplicater sð :‰:rcót|j«|j|jj««S)zl
Invert an image (channel). ::
out = MAX - image
:rtype: :py:class:`~PIL.Image.Image`
)ÚloadÚ_newÚimÚ chop_invertrs r Úinvertr)s)ð
‡JJ„LØ :‰:e—hh× -rcóª|j«|j«|j|jj|j««S)
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`
)rrrÚ chop_lighter©Úimage1Úimage2s r Úlighterr6s8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×-¨f¯i©iÓ 9rcóª|j«|j«|j|jj|j««S)
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`
)rrrÚ chop_darkerrs r Údarkerr!Es8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×,¨V¯Y©YÓ 8rcóª|j«|j«|j|jj|j««S)
Returns the absolute value of the pixel-by-pixel difference between the two
images. ::
out = abs(image1 - image2)
:rtype: :py:class:`~PIL.Image.Image`
)rrrÚchop_differencers r Ú
differencer$Ts8ð ‡KK„MØ
‡KK„MØ ;‰;v—y‘y×·±Ó <rcóª|j«|j«|j|jj|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`
)rrrÚ
chop_multiplyrs r Úmultiplyr'cs8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×.¨v¯y©yÓ :rcóª|j«|j«|j|jj|j««S)
Superimposes two inverted images on top of each other. ::
out = MAX - ((MAX - image1) * (MAX - image2) / MAX)
:rtype: :py:class:`~PIL.Image.Image`
)rrrÚ chop_screenrs r Úscreenr*ts8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×,¨V¯Y©YÓ 8rcóª|j«|j«|j|jj|j««S)z
Superimposes two images on top of each other using the Soft Light algorithm
:rtype: :py:class:`~PIL.Image.Image`
)rrrÚchop_soft_lightrs r Ú
soft_lightr-ó8ð ‡KK„MØ
‡KK„MØ ;‰;v—y‘y×·±Ó <rcóª|j«|j«|j|jj|j««S)z
Superimposes two images on top of each other using the Hard Light algorithm
:rtype: :py:class:`~PIL.Image.Image`
)rrrÚchop_hard_lightrs r Ú
hard_lightr1Žr.rcóª|j«|j«|j|jj|j««S)z|
Superimposes two images on top of each other using the Overlay algorithm
:rtype: :py:class:`~PIL.Image.Image`
)rrrÚ chop_overlayrs r Úoverlayr4šs8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×-¨f¯i©iÓ 9rcó®|j«|j«|j|jj|j||««S)
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`
)rrrÚchop_add©rrÚscaleÚoffsets r Úaddr:¦s<ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×)¨&¯)©)°U¸ Drcó®|j«|j«|j|jj|j||««S)
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`
)rrrÚ
chop_subtractr7s r Úsubtractr=·s<ð ‡KK„MØ
‡KK„MØ ;‰;v—y‘y×.¨v¯y©y¸Ó Ircóª|j«|j«|j|jj|j««S)z‡Add two images, without clipping the result. ::
out = ((image1 + image2) % MAX)
:rtype: :py:class:`~PIL.Image.Image`
)rrrÚchop_add_modulors r Ú
add_modulor@Ès8ð ‡KK„MØ
‡KK„MØ ;‰;v—y‘y×·±Ó <rcóª|j«|j«|j|jj|j««S)zŒSubtract two images, without clipping the result. ::
out = ((image1 - image2) % MAX)
:rtype: :py:class:`~PIL.Image.Image`
)rrrÚchop_subtract_modulors r Úsubtract_modulorCÕs8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×5°f·i±iÓ Arcóª|j«|j«|j|jj|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`
)rrrÚchop_andrs r Ú logical_andrFâs8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×)¨&¯)©)Ó 5rcóª|j«|j«|j|jj|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`
)rrrÚchop_orrs r Ú
logical_orrIôs8ð ‡KK„MØ
‡KK„MØ ;‰;v—y‘yׯ©Ó 4rcóª|j«|j«|j|jj|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`
)rrrÚchop_xorrs r Ú logical_xorrLs8ð ‡KK„MØ
‡KK„MØ ;‰;v—yy×)¨&¯)©)Ó 5rcó0tj|||«S)z‰Blend images using constant transparency weight. Alias for
:py:func:`PIL.Image.blend`.
:rtype: :py:class:`~PIL.Image.Image`
)rÚblend)rrÚalphas r rNrNsô ;‰;v˜v  -rcó0tj|||«S)z†Create composite using transparency mask. Alias for
:py:func:`PIL.Image.composite`.
:rtype: :py:class:`~PIL.Image.Image`
)rÚ composite)rrÚmasks r rQrQsô ?‰?˜6 6¨4Ó 0rNcó€||}|j«|j|jj||««S)aReturns 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`
)rrrr9)r
ÚxoffsetÚyoffsets r r9r9(s5ðØˆØ ‡JJ„LØ :‰:e—hh—oo g¨wÓ 8r)r
ú Image.Imager ÚintÚreturnrV)r
rVrXrV)rrVrrVrXrV)gð?r)
rrVrrVr8Úfloatr9rYrXrV)rrVrrVrOrYrXrV)rrVrrVrRrVrXrV)N)r
rVrTrWrUz