What is a sprite sheet?

A sprite sheet is a single image file that packs many smaller images, such as animation frames or icons, in a grid or atlas.

By · Updated

Explained in more detail

Instead of loading dozens of separate image files, a sprite sheet combines them into one. Each small image, called a sprite, sits at a known position, and software draws only the rectangle it needs.

In games, a character's walk cycle is stored as a row of frames. Playing the animation means drawing frame 0, then frame 1, then frame 2 from the same file. In web design, icon sets are often combined into one image and shown through CSS by setting background-position so only one icon is visible. This approach was especially important when every file cost a separate network request; with modern HTTP it matters less, but one file is still simpler to cache and manage.

Sprite sheets come in two layouts. A uniform grid has equal cells, so a frame's position is computed from its index. An atlas packs sprites of different sizes tightly and stores their rectangles in a separate data file.

Several image concerns show up here. Transparent PNG is the usual format, so sprites can sit over any background. Trimming each sprite to its bounding box before packing saves space, though you must then store the offset so it lines up in the animation. Padding between sprites prevents color bleeding, because smoothing or scaling can blend a pixel from one sprite into its neighbour.

Sheets also have dimension limits set by the platform or GPU, so very large atlases may need to be split.

Related terms

Try it in Triim

Sources

Part of the Triim image terms glossary, by Rocco Bombardieri.