A 3 × 3 grid from a 3000 × 2000 photo
- Input
- Photo 3000 × 2000 px, 3 columns × 3 rows
- Working
- Column boundaries: round(i × 3000 ÷ 3) = 0, 1000, 2000, 3000 — columns exactly 1000 px wide. Row boundaries: round(i × 2000 ÷ 3) = 0, 667, 1333, 2000 — row heights 667, 666 and 667. Tiles are therefore 1000 × 667, 1000 × 666 and 1000 × 667 by row, nine in total.
- Result
- Nine tiles in a ZIP: 3 columns of 1000 px, rows of 667 / 666 / 667 px