Fit sprite frames and verify their atlas rectangles
Admin ·
A frame has its own dimensions, while a sprite sheet adds spacing and arranges frames in rows. The JSON atlas states exactly where each frame begins.
Fit the source into a square and preserve alpha
Select Load example and Build sprite sheet. Contain puts the original 4 × 2 sample inside a 4 × 4 frame. One transparent row lies above the source and one below it.
Choose Fill with center crop to compare. From the source’s upper row, the green and blue columns fill the square. The red and white columns fall outside the crop.
WHATWG HTML Standard, image smoothing and nearest-neighbor samplingW3C Portable Network Graphics Third Edition
Check the third frame and the unused cell
Return to Contain with clear padding. Keep two columns, three copies per source and a one-pixel gap. The sheet is 9 × 9 pixels. The lower-right cell has no frame and stays transparent.
Download the atlas JSON and PNG. Atlas positions start at zero from the top-left of the sheet. Each rectangle covers its content and any padding inside the frame. The one-pixel gap lies outside it.
| Frame | Origin x, y | Width × height |
|---|---|---|
| 1 | 0, 0 | 4 × 4 |
| 2 | 5, 0 | 4 × 4 |
| 3 | 0, 5 | 4 × 4 |
Pack different images when the poses should change
Add a second local frame and set Copies per source to 1. Move it up or down if needed, then build again. The atlas source number follows the displayed source order.
Set a color limit to reduce visible RGB values per frame. Review each pose for lost detail before importing the PNG and using the JSON rectangles in your game or editor.
WHATWG HTML Standard, image smoothing and nearest-neighbor samplingW3C Portable Network Graphics Third Edition
Common questions
Does this create an animation?
The output is a still PNG sheet and a JSON coordinate list. A game or editor can use the separate frame rectangles to animate distinct source poses.
Why are edges crisp instead of softly blended?
Nearest-neighbor sampling copies one source pixel for each destination pixel. It keeps colors sharp and can skip fine marks when shrinking a frame.