ó
î Xc           @   sÅ   d  d l  m Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z	 d
 d d „ Z
 d
 d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d „ Z d S(   iÿÿÿÿ(   t   Imagec         C   s   t  j d |  j | ƒ S(   sV   Fill a channel with a given grey level.

    :rtype: :py:class:`~PIL.Image.Image`
    t   L(   R    t   newt   size(   t   imaget   value(    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   constant   s    c         C   s
   |  j  ƒ  S(   si   Copy a channel. Alias for :py:meth:`PIL.Image.Image.copy`.

    :rtype: :py:class:`~PIL.Image.Image`
    (   t   copy(   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt	   duplicate   s    c         C   s    |  j  ƒ  |  j |  j j ƒ  ƒ S(   s…   
    Invert an image (channel).

    .. code-block:: python

        out = MAX - image

    :rtype: :py:class:`~PIL.Image.Image`
    (   t   loadt   _newt   imt   chop_invert(   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   invert'   s    
c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   sÖ   
    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	   R
   R   t   chop_lighter(   t   image1t   image2(    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   lighter6   s    

c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   sÕ   
    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	   R
   R   t   chop_darker(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   darkerG   s    

c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   sË   
    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	   R
   R   t   chop_difference(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt
   differenceX   s    

c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   s6  
    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	   R
   R   t   chop_multiply(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   multiplyi   s    

c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   sÃ   
    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	   R
   R   t   chop_screen(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   screen|   s    

g      ð?i    c         C   s6   |  j  ƒ  | j  ƒ  |  j |  j j | j | | ƒ ƒ S(   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.

    .. code-block:: python

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

    :rtype: :py:class:`~PIL.Image.Image`
    (   R	   R
   R   t   chop_add(   R   R   t   scalet   offset(    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   addŒ   s    

c         C   s6   |  j  ƒ  | j  ƒ  |  j |  j j | j | | ƒ ƒ S(   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.

    .. code-block:: python

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

    :rtype: :py:class:`~PIL.Image.Image`
    (   R	   R
   R   t   chop_subtract(   R   R   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   subtract   s    

c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   s    Add two images, without clipping the result.

    .. code-block:: python

        out = ((image1 + image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    (   R	   R
   R   t   chop_add_modulo(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt
   add_modulo®   s    


c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   s¥   Subtract two images, without clipping the result.

    .. code-block:: python

        out = ((image1 - image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    (   R	   R
   R   t   chop_subtract_modulo(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   subtract_modulo½   s    


c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   s•   Logical AND between two images.

    .. code-block:: python

        out = ((image1 and image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    (   R	   R
   R   t   chop_and(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   logical_andÌ   s    


c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   s“   Logical OR between two images.

    .. code-block:: python

        out = ((image1 or image2) % MAX)

    :rtype: :py:class:`~PIL.Image.Image`
    (   R	   R
   R   t   chop_or(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt
   logical_orÛ   s    


c         C   s0   |  j  ƒ  | j  ƒ  |  j |  j j | j ƒ ƒ S(   s    Logical XOR between two images.

    .. code-block:: python

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

    :rtype: :py:class:`~PIL.Image.Image`
    (   R	   R
   R   t   chop_xor(   R   R   (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   logical_xorê   s    


c         C   s   t  j |  | | ƒ S(   s   Blend images using constant transparency weight. Alias for
    :py:meth:`PIL.Image.Image.blend`.

    :rtype: :py:class:`~PIL.Image.Image`
    (   R    t   blend(   R   R   t   alpha(    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyR*   ù   s    c         C   s   t  j |  | | ƒ S(   sŒ   Create composite using transparency mask. Alias for
    :py:meth:`PIL.Image.Image.composite`.

    :rtype: :py:class:`~PIL.Image.Image`
    (   R    t	   composite(   R   R   t   mask(    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyR,     s    c         C   s;   | d k r | } n  |  j ƒ  |  j |  j j | | ƒ ƒ S(   s~  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(   t   NoneR	   R
   R   R   (   R   t   xoffsett   yoffset(    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyR     s    	
N(   t   PILR    R   R   R   R   R   R   R   R   R   R   R!   R#   R%   R'   R)   R*   R,   R.   R   (    (    (    s2   /usr/lib/python2.7/dist-packages/PIL/ImageChops.pyt   <module>   s$   																
	
