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
ãó—ddlmZddlmZdd„Zdd„Zdd„Zdd„Zdd„Zdd „Z dd
„Z
dd „Z dd „Z dd
„Z
dd„Z d dd„Z d dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z d d„Zd!d"d„Zy)#é)Ú annotationsé)ÚImagecóD—tjd|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‰9�S˜%Ÿ*™* eÓ ,Ð,ó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)€ð
‡J�J„LØ �:‰:�e—h‘h×*Ñ*Ó,Ó -Ð-rcóª—|j«|j«|j|jj|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`
)rrrÚ chop_lighter©Úimage1Úimage2s r Úlighterr6s8€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×-Ñ-¨f¯i©iÓ8Ó 9Ð9rcóª—|j«|j«|j|jj|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`
)rrrÚ chop_darkerrs r Údarkerr!Es8€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×,Ñ,¨V¯Y©YÓ7Ó 8Ð8rcóª—|j«|j«|j|jj|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`
)rrrÚchop_differencers r Ú
differencer$Ts8€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×0Ñ0°·±Ó;Ó <Ð<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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×.Ñ.¨v¯y©yÓ9Ó :Ð:rcóª—|j«|j«|j|jj|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`
)rrrÚ chop_screenrs r Úscreenr*ts8€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×,Ñ,¨V¯Y©YÓ7Ó 8Ð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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×0Ñ0°·±Ó;Ó <Ð<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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×-Ñ-¨f¯i©iÓ8Ó 9Ð9rcó®—|j«|j«|j|jj|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`
)rrrÚchop_add©rrÚscaleÚoffsets r Úaddr:¦s<€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×)Ñ)¨&¯)©)°U¸FÓCÓ DÐDrcó®—|j«|j«|j|jj|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`
)rrrÚ
chop_subtractr7s r Úsubtractr=·s<€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×.Ñ.¨v¯y©y¸%ÀÓHÓ IÐ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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×0Ñ0°·±Ó;Ó <Ð<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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×5Ñ5°f·i±iÓ@Ó AÐ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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×)Ñ)¨&¯)©)Ó4Ó 5Ð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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×(Ñ(¨¯©Ó3Ó 4Ð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€ð ‡K�K„MØ
‡K�K„MØ �;‰;�v—y‘y×)Ñ)¨&¯)©)Ó4Ó 5Ð5rcó0—tj|||«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 uÓ -Ð-rcó0—tj|||«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Ó 0Ð0rNcó€—|€|}|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 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€ð€ØˆØ ‡J�J„LØ �:‰:�e—h‘h—o‘o g¨wÓ7Ó 8Ð8r)r
ú Image.Imager ÚintÚreturnrV)r
rVrXrV)rrVrrVrXrV)gð?r)
rrVrrVr8Úfloatr9rYrXrV)rrVrrVrOrYrXrV)rrVrrVrRrVrXrV)N)r
rVrTrWrUz