Sprite Sheets

From ETC Public Wiki
Jump to: navigation, search

To convert PNG Sequences to sprite sheets you need to have Imagemagick installed. [1]

This is a command line utility that manipulates images. For this project, this is the software that collects all of the images and places them onto one larger image. For our project this image cannot be larger than 9M as shown by the Photoshop image size utility. In general this means that square images cannot be larger than 1774x1773.

To convert a PNG sequence to a sprite sheet you need to do the following:

  1. Open a command window by clicking Start->Search->Type in Command and hit Enter
  2. Once open navigate to the folder that the PNG sequence is in
  3. Type in the following command

montage *.png -background "transparent" -geometry +2+2 -tile 5x6 spritesheet.png

This command does the following:

  • Creates a spritesheet using ALL of the images in the folder you're in
  • It puts 2 pixels around each side of the image (for a total of 4 pixels added in each direction)
  • Creates the images in a grid from left to right starting at the top of the image
  • Creates a grid based on the numbers entered
    • The example would create a grid of 5 columns and 6 rows
  • The resulting image is called spritesheet.png and is placed in the same folder as the png sequence
    • NOTE: If you make a mistake and need to recreate the spritesheet it will include the previous one created in the new spritesheet