▦

Sprite Sheet Generator

Arrange multiple images into a downloadable PNG sprite sheet

No file selected.

Sprite Sheet Generator — what it does

Arrange multiple images into a single PNG sprite sheet with a column count, padding and background colour of your choosing. Sprite sheets exist because one image request is cheaper than twenty, and because a game engine or CSS rule can address each frame by its position in the grid.

When this tool helps

  • Packing animation frames into one sheet for a game engine or canvas animation.
  • Combining interface icons into a single file addressed by CSS background position.
  • Bundling a set of small images to reduce the number of requests a page makes.

How to use it

  1. Choose the images in frame order.
  2. Set the number of columns.
  3. Set padding and background colour.
  4. Generate and download the sprite sheet.

Accuracy, limits, and good practice

  • Frames of identical size make the grid predictable, which is what lets code compute each frame's offset arithmetically.
  • Padding prevents neighbouring frames bleeding into each other when the sheet is scaled or filtered, at the cost of a slightly larger file.
  • Note the column count and frame size once generated — your code needs both to address the right cell.

Frequently asked questions

How do I use a sprite sheet in CSS?

Set the sheet as a background image and shift background-position by multiples of the frame size to show each icon.

Are sprite sheets still worth it on the web?

Less so under HTTP/2, where parallel requests are cheap. They remain standard for game animation frames.

Should frames be the same size?

For animation and code-driven addressing, yes. Uneven frames need a coordinate map rather than simple arithmetic.

Related tools on this site

Everything above runs inside this page. Sprite Sheet Generator needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

圖片精靈圖生成器能做什麼

把多張圖片排成單一 PNG 精靈圖,欄數、間距與背景色由你決定。精靈圖之所以存在,是因為一次圖片請求比二十次便宜,也因為遊戲引擎或 CSS 規則能依格線位置指定每一格。

什麼時候用得上

  • 把動畫影格打包成一張圖,供遊戲引擎或 canvas 動畫使用。
  • 把介面圖示合併成單一檔案,用 CSS 背景位置定位。
  • 把一組小圖打包,減少頁面發出的請求數。

使用步驟

  1. 依影格順序選擇圖片。
  2. 設定欄數。
  3. 設定間距與背景色。
  4. 產生並下載精靈圖。

精確度、限制與實務建議

  • 尺寸一致的影格能讓格線可預測,程式才能用算術直接算出每格的偏移量。
  • 間距可避免縮放或濾鏡時相鄰影格互相滲色,代價是檔案略大。
  • 產生後請記下欄數與影格尺寸——程式需要這兩個數字才能定位正確格子。

常見問題

CSS 中怎麼使用精靈圖?

把整張圖設為背景圖,再依影格尺寸的倍數位移 background-position,即可顯示各個圖示。

網頁上還值得用精靈圖嗎?

在 HTTP/2 之下效益較小,因為並行請求成本很低。但它在遊戲動畫影格上仍是標準做法。

影格需要一樣大嗎?

用於動畫與程式定位時需要。尺寸不一的影格需要座標對照表,而非單純算術。

本站相關工具

以上步驟全部在這個頁面內完成,圖片精靈圖生成器 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。