U
    a¨+d¦  ã                   @   s   d dl Zddd„ZdS )é    NTc                    sb   |dkrdddg}|dkr$dddg}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é   ZCRT_phosphorg333333Ë?gjÞqŠŽäæ?gL¦
F%u²?g      ð?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   é   é   Zuint8)ÚnpZdstackZastype)Zim©ÚBÚGÚR© ú?/tmp/pip-unpacked-wheel-0yp4gafk/moviepy/video/fx/blackwhite.pyÚfl   s    Nzblackwhite.<locals>.fl)r   ÚarrayÚsumZfl_image)ZclipZRGBZpreserve_luminosityr   r
   r   r   Ú
blackwhite   s    

$r   )NT)Znumpyr   r   r
   r
   r
   r   Ú<module>   s   