How can I use Python to layout a page of images efficiently? or What’s the best way to use Python to

16 Replies, 1467 Views

For real tho, why not `OpenCV`? Yeah it’s overkill, but `cv2.resize` + `numpy` hstack/vstack makes grid layouts a breeze.

Here’s a snippet:
```python
import cv2
import numpy as np
# stack images horizontally/vertically
grid = np.vstack([np.hstack([img1, img2]), np.hstack([img3, img4])])
```

Messages In This Thread



Users browsing this thread: 1 Guest(s)