o
    Y+i                  	   @   sz   d Z zddlmZ W n   zddlmZ W n   dZ Y Y ddlZdddZdd	d
Ze s;ejZ	ddd
Ze	e_dS 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    )axis      r   uint8)r   meannpdstackmaximumminimumastype)image
saturationblackedges	darkeningpainting r   L/var/www/html/venv/lib/python3.10/site-packages/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   )imr   r   r   r   <lambda>   s    zpainting.<locals>.<lambda>)fl_image)clipr   r   r   r   r   r      s   r   c                 C   s   t d)Nz'fx painting needs scikit-image or scipy)IOError)r   newsizeheightwidthr   r   r   r   '   s   )r   r   )NNN)
painting_possibleskimage.filterr   scipy.ndimage.filtersnumpyr   r   r   __doc__docr   r   r   r   <module>   s"   



