
    i7                         d Z ddlZd Zd Zy)zs
This module implements all the functions to communicate with other Python
modules (PIL, matplotlib, mayavi, etc.)
    Nc                 ,    t        j                  |       S )zt Transforms a PIL/Pillow image into a numpy RGB(A) image.
        Actually all this do is returning numpy.array(im).)nparray)ims    W/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/moviepy/video/io/bindings.pyPIL_to_npimager   	   s     88B<    c                 D   ddl m}  ||       }|j                          |j                  j                  j
                  \  }}}}t        |      t        |      }}|j                         }t        j                  |t        j                        }|j                  ||d      S )zF Converts a matplotlib figure to a RGB frame after updating the canvasr   )FigureCanvasAgg)dtype   )matplotlib.backends.backend_aggr   drawfigurebboxboundsinttostring_rgbr   
frombufferuint8reshape)	figr   canvaslbwhbufimages	            r   mplfig_to_npimager       s     @S!F
KKM mm  ''GAa!q63q6qA 


C==BHH-E==1Qr	   )__doc__numpyr   r   r     r	   r   <module>r$      s   
  r	   