New FeatureDecember 28, 2025v2.5.0
Partitioning photo gallery layout
Our screenshot composition API now includes a new partitioning layout that creates beautifully balanced photo galleries - the same algorithm used by Telegram and Google Photos.
How it works
The partitioning layout uses dynamic programming to find the optimal arrangement:
- Each row fills the available width completely
- All images in a row share the same height
- Row heights are balanced to be as similar as possible
{
"urls": [
"https://example.com/photo1",
"https://example.com/photo2",
"https://example.com/photo3",
"https://example.com/photo4"
],
"layout": "partitioning",
"width": 1200,
"height": 800
}Perfect for
- Social media preview images
- Photo collages and galleries
- Portfolio presentations
- Product image grids
Available layouts
This brings our composition layouts to five options:
- Grid: Equal-sized cells in rows and columns
- Masonry: Pinterest-style staggered layout
- Mondrian: Abstract art-inspired geometric blocks
- Partitioning: Balanced rows with variable column counts (new!)
- Freeform: Custom positioning with absolute coordinates