Numpy Integration
In this lesson, we'll learn r to integrate numpy with Pycairo.
We'll cover the following...
We'll cover the following...
Creating a numpy array from a surface
We can create a numpy array from an ImageSurface like this:
We create our red square image in the same way that we did in the Pillow example. Then, we obtain the data using the get_data function. There is no need to convert the data to a byte buffer, because numpy understands memoryview objects.
We ...