Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/PIL/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/PIL/__pycache__/ImageChops.cpython-35.pyc



�ʴW(�@s�ddlmZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dddd�Z
dddd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&d'�Zd%S)(�)�ImagecCstjd|j|�S)zVFill a channel with a given grey level.

    :rtype: :py:class:`~PIL.Image.Image`
    �L)r�new�size)�image�value�r�A/opt/alt/python35/lib64/python3.5/site-packages/PIL/ImageChops.py�constantsr
cCs
|j�S)ziCopy a channel. Alias for :py:meth:`PIL.Image.Image.copy`.

    :rtype: :py:class:`~PIL.Image.Image`
    )�copy)rrrr	�	duplicatesrcCs |j�|j|jj��S)z�
    Invert an image (channel).

    .. code-block:: python

        out = MAX - image

    :rtype: :py:class:`~PIL.Image.Image`
    )�load�_new�imZchop_invert)rrrr	�invert's
rcCs0|j�|j�|j|jj|j��S)z�
    Compares the two images, pixel by pixel, and returns a new image containing
    the lighter values.

    .. code-block:: python

        out = max(image1, image2)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_lighter)�image1�image2rrr	�lighter6s

rcCs0|j�|j�|j|jj|j��S)z�
    Compares the two images, pixel by pixel, and returns a new image
    containing the darker values.

    .. code-block:: python

        out = min(image1, image2)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_darker)rrrrr	�darkerGs

rcCs0|j�|j�|j|jj|j��S)z�
    Returns the absolute value of the pixel-by-pixel difference between the two
    images.

    .. code-block:: python

        out = abs(image1 - image2)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_difference)rrrrr	�
differenceXs

rcCs0|j�|j�|j|jj|j��S)a6
    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.

    .. code-block:: python

        out = image1 * image2 / MAX

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZ
chop_multiply)rrrrr	�multiplyis

rcCs0|j�|j�|j|jj|j��S)z�
    Superimposes two inverted images on top of each other.

    .. code-block:: python

        out = MAX - ((MAX - image1) * (MAX - image2) / MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_screen)rrrrr	�screen|s

rg�?cCs6|j�|j�|j|jj|j||��S)a
    Adds two images, dividing the result by scale and adding the
    offset. If omitted, scale defaults to 1.0, and offset to 0.0.

    .. code-block:: python

        out = ((image1 + image2) / scale + offset)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_add)rr�scale�offsetrrr	�add�s

rcCs6|j�|j�|j|jj|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.

    .. code-block:: python

        out = ((image1 - image2) / scale + offset)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZ
chop_subtract)rrrrrrr	�subtract�s

rcCs0|j�|j�|j|jj|j��S)z�Add two images, without clipping the result.

    .. code-block:: python

        out = ((image1 + image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_add_modulo)rrrrr	�
add_modulo�s


rcCs0|j�|j�|j|jj|j��S)z�Subtract two images, without clipping the result.

    .. code-block:: python

        out = ((image1 - image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_subtract_modulo)rrrrr	�subtract_modulo�s


rcCs0|j�|j�|j|jj|j��S)z�Logical AND between two images.

    .. code-block:: python

        out = ((image1 and image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_and)rrrrr	�logical_and�s


rcCs0|j�|j�|j|jj|j��S)z�Logical OR between two images.

    .. code-block:: python

        out = ((image1 or image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_or)rrrrr	�
logical_or�s


rcCs0|j�|j�|j|jj|j��S)z�Logical XOR between two images.

    .. code-block:: python

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

    :rtype: :py:class:`~PIL.Image.Image`
    )r
rrZchop_xor)rrrrr	�logical_xor�s


r cCstj|||�S)z�Blend 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!cCstj|||�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#NcCs8|dkr|}|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 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	r
s
r)ZPILrr
rrrrrrrrrrrrrr r!r#rrrrr	�<module>s$