
     f
                        d dl mZ ddlmZ d*d	Zd+d
Zd+dZd,dZd,dZd,dZ	d,dZ
d,dZd,dZd,dZd,dZ	 d-d.dZ	 d-d.dZd,dZd,dZd,dZd,dZd,d Zd/d"Zd0d$Zd1d2d)Zd%S )3    )annotations   )ImageimageImage.Imagevalueintreturnc                8    t          j        d| j        |          S )zVFill a channel with a given gray level.

    :rtype: :py:class:`~PIL.Image.Image`
    L)r   newsize)r   r   s     Q/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/PIL/ImageChops.pyconstantr      s     9S%*e,,,    c                *    |                                  S )ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`.

    :rtype: :py:class:`~PIL.Image.Image`
    )copyr   s    r   	duplicater       s     ::<<r   c                    |                                   |                     | j                                                  S )zl
    Invert an image (channel). ::

        out = MAX - image

    :rtype: :py:class:`~PIL.Image.Image`
    )load_newimchop_invertr   s    r   invertr   )   s1     
JJLLL::eh**,,---r   image1image2c                    |                                   |                                  |                     | 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`
    )r   r   r   chop_lighterr   r   s     r   lighterr!   6   sB     KKMMM
KKMMM;;vy--fi88999r   c                    |                                   |                                  |                     | 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`
    )r   r   r   chop_darkerr    s     r   darkerr$   E   sB     KKMMM
KKMMM;;vy,,VY77888r   c                    |                                   |                                  |                     | 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`
    )r   r   r   chop_differencer    s     r   
differencer'   T   sB     KKMMM
KKMMM;;vy00;;<<<r   c                    |                                   |                                  |                     | 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`
    )r   r   r   chop_multiplyr    s     r   multiplyr*   c   sB     KKMMM
KKMMM;;vy..vy99:::r   c                    |                                   |                                  |                     | 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`
    )r   r   r   chop_screenr    s     r   screenr-   t   sB     KKMMM
KKMMM;;vy,,VY77888r   c                    |                                   |                                  |                     | j                            |j                            S )z
    Superimposes two images on top of each other using the Soft Light algorithm

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   chop_soft_lightr    s     r   
soft_lightr0      B     KKMMM
KKMMM;;vy00;;<<<r   c                    |                                   |                                  |                     | j                            |j                            S )z
    Superimposes two images on top of each other using the Hard Light algorithm

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   chop_hard_lightr    s     r   
hard_lightr4      r1   r   c                    |                                   |                                  |                     | j                            |j                            S )z|
    Superimposes two images on top of each other using the Overlay algorithm

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   chop_overlayr    s     r   overlayr7      sB     KKMMM
KKMMM;;vy--fi88999r         ?scalefloatoffsetc                    |                                   |                                  |                     | 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`
    )r   r   r   chop_addr   r   r9   r;   s       r   addr?      sF     KKMMM
KKMMM;;vy))&)UFCCDDDr   c                    |                                   |                                  |                     | 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`
    )r   r   r   chop_subtractr>   s       r   subtractrB      sF     KKMMM
KKMMM;;vy..vy%HHIIIr   c                    |                                   |                                  |                     | j                            |j                            S )zAdd two images, without clipping the result. ::

        out = ((image1 + image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   chop_add_modulor    s     r   
add_modulorE      sB     KKMMM
KKMMM;;vy00;;<<<r   c                    |                                   |                                  |                     | j                            |j                            S )zSubtract two images, without clipping the result. ::

        out = ((image1 - image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   chop_subtract_modulor    s     r   subtract_modulorH      sB     KKMMM
KKMMM;;vy55fi@@AAAr   c                    |                                   |                                  |                     | j                            |j                            S )aj  Logical 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`
    )r   r   r   chop_andr    s     r   logical_andrK      sB     KKMMM
KKMMM;;vy))&)44555r   c                    |                                   |                                  |                     | j                            |j                            S )zLogical OR between two images.

    Both of the images must have mode "1". ::

        out = ((image1 or image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   chop_orr    s     r   
logical_orrN      sB     KKMMM
KKMMM;;vy((33444r   c                    |                                   |                                  |                     | j                            |j                            S )zLogical XOR between two images.

    Both of the images must have mode "1". ::

        out = ((bool(image1) != bool(image2)) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r   r   r   chop_xorr    s     r   logical_xorrQ     sB     KKMMM
KKMMM;;vy))&)44555r   alphac                .    t          j        | ||          S )zBlend images using constant transparency weight. Alias for
    :py:func:`PIL.Image.blend`.

    :rtype: :py:class:`~PIL.Image.Image`
    )r   blend)r   r   rR   s      r   rT   rT     s     ;vvu---r   maskc                .    t          j        | ||          S )zCreate composite using transparency mask. Alias for
    :py:func:`PIL.Image.composite`.

    :rtype: :py:class:`~PIL.Image.Image`
    )r   	composite)r   r   rU   s      r   rW   rW     s     ?664000r   Nxoffsetyoffset
int | Nonec                    ||}|                                   |                     | 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`
    )r   r   r   r;   )r   rX   rY   s      r   r;   r;   (  s=     	JJLLL::ehoogw77888r   )r   r   r   r	   r
   r   )r   r   r
   r   )r   r   r   r   r
   r   )r8   r   )
r   r   r   r   r9   r:   r;   r:   r
   r   )r   r   r   r   rR   r:   r
   r   )r   r   r   r   rU   r   r
   r   )N)r   r   rX   r	   rY   rZ   r
   r   )
__future__r    r   r   r   r   r!   r$   r'   r*   r-   r0   r4   r7   r?   rB   rE   rH   rK   rN   rQ   rT   rW   r;    r   r   <module>r_      s  $ # " " " " "      - - - -   
. 
. 
. 
.: : : :9 9 9 9= = = =; ; ; ;"9 9 9 9	= 	= 	= 	=	= 	= 	= 	=	: 	: 	: 	: STE E E E E$ STJ J J J J"
= 
= 
= 
=
B 
B 
B 
B6 6 6 6$5 5 5 56 6 6 6. . . .	1 	1 	1 	19 9 9 9 9 9 9r   