U
    a+d                  	   @   s~   d Z zddlmZ W n.   zddlmZ W n   dZ Y nX Y nX ddlZdddZdd	d
Ze szejZ	ddd
Ze	e_dS )T    )sobelFNffffff?~jtx?c                 C   sN   t | jdd}|dtd|g   }||  | }tdtd|dS )z1 transforms any photo into some kind of painting    )Zaxis      r   Zuint8)r   ZmeannpZdstackmaximumZminimumZastype)image
saturationblackedgesZ	darkeningpainting r   =/tmp/pip-unpacked-wheel-0yp4gafk/moviepy/video/fx/painting.pyto_painting   s    r   c                    s   |   fddS )z
    Transforms any photo into some kind of painting. Saturation
    tells at which point the colors of the result should be
    flashy. ``black`` gives the anount of black lines wanted.
    Requires Scikit-image or Scipy installed.
    c                    s   t |  S )N)r   )Zimr   r   r   r   <lambda>       zpainting.<locals>.<lambda>)Zfl_image)clipr   r   r   r   r   r      s    r   c                 C   s   t dd S )Nz'fx painting needs scikit-image or scipy)IOError)r   Znewsizeheightwidthr   r   r   r   '   s    )r   r   )r   r   )NNN)
Zpainting_possibleZskimage.filterr   Zscipy.ndimage.filtersZnumpyr   r   r   __doc__docr   r   r   r   <module>   s   


