
    i                         d dl ZddZy)    Nc                     |g d}|dk(  rg d}dt        j                  |      z  |rt        |      ndz  \  fd}| j                  |      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.)   r   r   CRT_phosphor)g333333?gjq?gL
F%u?g      ?r   c                     | d d d d df   z  | d d d d df   z  z   | d d d d df   z  z   } t        j                  d| gz        j                  d      S )Nr   r         uint8)npdstackastype)imBGRs    Y/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/moviepy/video/fx/blackwhite.pyflzblackwhite.<locals>.fl   s\    1Qq5	kAb1QiK'!Bq1uI+5yyB4 ''00    )r
   arraysumfl_image)clipRGBpreserve_luminosityr   r   r   r   s       @@@r   
blackwhiter      sX     {
n&,?CQGEAa1 ==r   )NT)numpyr
   r    r   r   <module>r      s    r   