How to use
- Drop icons or animation frames onto the box. Up to 500 images at a time.
- Choose a layout: grid, horizontal strip, vertical strip or tight packing.
- Set spacing, outer margin and the background (transparent or a color). Turn on @2x for retina images.
- The sheet preview, CSS and JSON appear. Download ZIP saves the sheet image,
sprite.cssandsprite.jsontogether; CSS and JSON can also be copied individually.
The order you add the files is the order in the sheet and the order of animation frames. To reorder, remove files and add them again in the order you want.
Layouts
| Layout | What it does | Good for |
|---|---|---|
| Grid | You set the column count; every image sits centered in a cell as large as the biggest image | Same-size icons, animation frames |
| Horizontal / vertical strip | One line, centered across the line | Animations with many frames |
| Tight packing | Fills horizontal rows (shelves) from tallest to shortest to cut empty space; results come back in input order | Images of different sizes |
With power of 2 on in tight packing, the sheet width and height snap to values like 64, 128 or 256, which some game engines and GPU textures require.
Example: one 64×64, two 32×32, one 16×48 and one 48×16 image with zero spacing and margin. Tight packing gives 80×112, a 3-column grid gives 192×128 and a horizontal strip gives 192×64.
Class name rules
The file extension is dropped, and only lowercase letters, digits and hyphens are kept. A name starting with a digit gets an i- prefix, and duplicates get -2, -3. A name made only of characters that are filtered out, such as Korean letters, becomes item.
| File name | Class |
|---|---|
Icon Home.png |
icon-home |
search.png |
search |
1st.png |
i-1st |
search.svg (second) |
search-2 |
The CSS and JSON you get
Four 32×32 icons in 3 columns with 2px spacing make a 100×66px sheet.
.sprite { background-image: url(sprite.png); background-repeat: no-repeat; display: inline-block; }
.sprite-icon-home { width: 32px; height: 32px; background-position: 0 0; }
.sprite-search { width: 32px; height: 32px; background-position: -34px 0; }
.sprite-i-1st { width: 32px; height: 32px; background-position: -68px 0; }
.sprite-search-2 { width: 32px; height: 32px; background-position: 0 -34px; }
In HTML, combine the base class with the item class: <span class="sprite sprite-search"></span>. The negative background-position values slide the sheet left and up so the right piece shows through the element.
With @2x the sheet is treated as a double-resolution image and the CSS sizes are halved. The example becomes width: 16px; height: 16px; with background-size: 50px 33px;, and positions are halved too. If an image has an odd width or height you can get values like 7.5px.
The JSON uses TexturePacker’s “hash” format (frame and sourceSize per name in frames, sheet size and image name in meta), so engines such as Phaser and PixiJS can load it as an atlas.
When sprites still make sense
Sprite sheets cut the number of image requests and bundle animation frames into one file. Today, though, HTTP/2 makes many small files cheap, and SVG icons stay sharp and can be recolored with CSS, so web icons are often SVG. Sprite sheets remain a good fit for game sprites, raster icon sets and legacy sites.
A sheet can be up to 8000px per side and 40 million pixels in total. To cut an image into pieces use Split Image, to embed a single image in code use Image to Base64, and to tidy the generated CSS use CSS Beautifier & Minifier.
Your files are processed in your browser and never sent to a server.