About
Tool No. 79 of Pikkola, 28 November 2026
A sprite sheet is a cache decision written as an image: one request instead of forty, one file to invalidate instead of forty. The packing is simple on purpose, and the CSS is written from the same rectangles the drawing used.
What it does
- Packs dropped image frames, or six sample frames drawn in the tab, onto shelves with a chosen width and gap.
- Draws the sheet on a canvas and encodes it as a PNG the browser produces, with its own byte size reported.
- Writes CSS for every frame in two-axis and single-row forms, and a JSON manifest of the rectangles.
- Slices a sheet you already have into rows and columns, with an offset, and writes the CSS for every cell.
The shelf layout
Frames are sorted by height, tallest first, and each is placed on the first row where it fits. Rows grow from the left and start again below the tallest frame of the previous row. It is not the tightest packing and it does not need to be: the same frames in the same order always produce the same sheet, which is what a build artefact needs.
Why the CSS cannot drift from the picture
Both are written from one list of placed rectangles. A background position is the negation of the rectangle's corner, and a width is its width, so a rule that disagrees with the drawing is not a possible state of this page.
What the slicer is for
A sheet that already ships has no manifest. Dividing it into a grid recovers the cells when the frames are evenly sized, and the offset field trims the one-pixel border a texture tool sometimes adds. A sheet with rows of different heights cannot be read by rows and columns alone, and the page says so rather than guessing.
What it is not
It is not an optimiser. It does not try several layouts, does not quantise the palette, does not read a texture atlas format and does not promise a smaller file than your originals added up.
Contact
A sheet this page packs or slices wrongly is worth the frames and the numbers: hello@pikkola.com.