o
    Y+i¦  ã                   @   s   d dl Zddd„ZdS )é    NTc                    s^   |du rg d¢}|dkrg d¢}dt  |¡ |rt|ƒnd \‰‰‰ ‡ ‡‡fdd„}|  |¡S )	zö Desaturates the picture, makes it black and white.
    Parameter RGB allows to set weights for the different color
    channels.
    If RBG is 'CRT_phosphor' a special set of values is used.
    preserve_luminosity maintains the sum of RGB to 1.N)é   r   r   ÚCRT_phosphor)g333333Ë?gjÞqŠŽäæ?gL¦
F%u²?g      ð?r   c                    sd   ˆ| d d …d d …df  ˆ| d d …d d …df   ˆ | d d …d d …df   } t  d| g ¡ d¡S )Nr   r   é   é   Úuint8)ÚnpÚdstackÚastype)Úim©ÚBÚGÚR© úN/var/www/html/venv/lib/python3.10/site-packages/moviepy/video/fx/blackwhite.pyÚfl   s   Nzblackwhite.<locals>.fl)r   ÚarrayÚsumÚfl_image)ÚclipÚRGBÚpreserve_luminosityr   r   r   r   Ú
blackwhite   s   $
r   )NT)Únumpyr   r   r   r   r   r   Ú<module>   s    