![example picture for create_image_from_numpy()](/images/reference/Sketch_create_image_from_numpy_0.png)

```python
import numpy as np
def setup():
r = np.linspace(0, 255, num=py5.width).reshape(1, -1)
g = np.linspace(0, 255, num=py5.height).reshape(-1, 1)
b = 255
rgb = np.dstack(np.broadcast_arrays(r, g, b)).astype(np.uint8)
img = py5.create_image_from_numpy(rgb, 'RGB')
py5.image(img, 0, 0)
```