🧩Grid & Carousel Image Slicer Documentation & Guide
📋How to Slice an Image Into Tiles
- Upload Image or Load Demo: Choose your source PNG/JPG/WebP image or load a sample panorama.
- Set Columns & Rows: Specify horizontal columns and vertical rows (or click 3x1 Carousel / 3x3 Grid preset).
- Generate & Save Tiles: Click Slice Image Grid and save each numbered tile individually.
⚙️Exact Sub-Region Canvas Tile Extraction▼
Divides `naturalWidth / cols` and `naturalHeight / rows` cleanly into integer pixel tile rectangles, invoking Canvas `drawImage(img, sx, sy, tw, th, 0, 0, tw, th)` per tile with zero seam overlap.
📐Formula & Mathematical Architecture▼
TileHeight = floor(NaturalHeight ÷ Rows)
🧮Concrete Worked Examples▼
900x600 banner, 3 Cols x 1 Row3 seamless tiles (300x600 px each)Divides width evenly by 3 while preserving full vertical height.
900x600 image, 3 Cols x 3 Rows9 sequential grid tiles (300x200 px each)Produces 9 ordered tiles ready to upload in sequence.
⚠️Common Pitfalls & Edge Cases▼
- ⚠️Uploading a portrait photo when making a 3×1 wide carousel (wide 3:1 or 3:2 photos work best).
- ⚠️Posting 3×3 grid tiles in normal 1-to-9 order instead of 9-down-to-1 when building profile murals.
- ⚠️Forgetting to keep grid dimensions divisible cleanly when pixel-art sprite tiles require exact 32×32 bounds.
💡Social Media & Game Dev Uses▼
- Turning wide landscape photos into swipeable 3-slide Instagram carousels.
- Chopping uniform UI icon or sprite sheets into individual PNG files.