My graphics designer has made graphics in separate PNG files. Is there a clever tool/script that mashes them into a spritesheet?
I could probably code something myself, but why re-invent the wheel :)
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityMy graphics designer has made graphics in separate PNG files. Is there a clever tool/script that mashes them into a spritesheet?
I could probably code something myself, but why re-invent the wheel :)
Am I the only one who uses SpriteSheetPacker? It's free and open source so you can modify it and learn how it works.
I've been using TexturePacker to create sprites from a folder of PNG images. I'm porting a game originally developed in Flash, so I'm simply exporting each frame of the MovieClip to png and then importing those images in Texture Packer.
Another similar tool is Zwoptex
(The latter is Mac software, but TP has a version for Windows too.)
ImageMagick has a command line utility that can join images into what it calls a "montage." It can be tiring getting the right command line parameters to do what you want, but it's a very powerful and flexible tool. I use it very frequently for building spritesheets.
convert +append folder/*.png stacked.png
converts all pngs in folder (ordered alphabetically) into stacked.png
\$\endgroup\$
Aug 18, 2018 at 10:40
I have decided to open source my 2D spritesheet and animation tool. It supports automatic sprite selection, combining images, sprite grouping, and multi-sprite animation with rotation.
It is written in Java, the github repo is here: https://github.com/darkFunction/darkFunction-Editor
Website for the project is: http://darkfunction.com/editor
I really like libgdx's (game framework) packer. Maybe a bit cumbersome to set up the framework just for the packer, though.
The packer works great. Read the libgdx texturepacker doc here, and see for yourself. My favourite feature is that is also saves a document with info about all the textures in the big spritesheet/atlas, so you can easily make a script that gets them for you. Libgdx also has this build in, so I can load/display any texture by it's original filename, even though it's in a big atlas. There also exists a GUI for the packer.
Excerpt from a pack-file with info about some textures:
ferdige1.png
format: RGBA8888
filter: Nearest,Nearest
repeat: none
mainmenu
rotate: false
xy: 2, 2
size: 800, 480
orig: 800, 480
offset: 0, 0
index: -1
plankeu3
rotate: false
xy: 804, 2
size: 64, 384
orig: 64, 384
offset: 0, 0
index: -1
levelSelect
rotate: false
xy: 2, 484
size: 591, 373
orig: 591, 373
offset: 0, 0
index: -1
plankeu2
rotate: false
xy: 870, 2
size: 64, 256
orig: 64, 256
offset: 0, 0
index: -1
I ended up using this Processing script. You can download Processing for free at Processing.org. All files need to be in the same folder, and have a filename ending in a 4 digit number.
ArrayList<PImage> images = new ArrayList
<PImage>();
void setup() {
String folder = "file location ...";
String file = "file prefix ...";
String outfile = "output.png";
int fileCount = 30;
int cols = 7;
int rows = 5;
println("Loadgin...");
for (int i = 1; i <= fileCount; i++) {
String number = "" + i;
if(number.length() == 1) number ="000" + number;
else if(number.length() == 2) number = "00" + number;
PImage img = loadImage(folder+file + number +".png");
images.add(img);
}
println("Starting...");
PImage img = createImage(images.get(0).width * cols, images.get(0).height * rows, ARGB);
for (int x = 0; x < images.get(0).width; x++) {
for (int y = 0; y < images.get(0).height; y++) {
for (int z = 0; z < images.size(); z++) {
img.set(
x+images.get(0).width* (z%cols),
y +images.get(0).height * int(z/cols),
images.get(z).get(x,y));
}
}
}
println("Saving...");
img.save(folder + outfile);
}
I don't know if I understood question correcttly but I know the software that operates with textures and makes animation, sprite sheets anf .gif animations. see http://www.spritetools.com/
I use a Photoshop script to make spritesheets, see this article on my blog.
It can make old skool tile grids as well as texture atlases, and can export a custom text file containing image size and position info. It works on PC and Mac, it's open source and written to be extensible.