Is there any good tools/plugins/program, etc to produce spritesheet from several image files?
I am on linux, so suggestions for windows (via wine) works, too.
Especially i'm interested in something that can be easly automated (so, for example, i can write script to create spritesheet for specific directory when i run it).
Any suggestions?
Several images to spritesheet
Re: Several images to spritesheet
You can do it with Aseprite (at least on windows). If all the frames of your animation are named following some convention like idle_1.png, idle_2.png, run_1.png, run_2.png when you open one of the files it will ask you if you want to import the other files as animation frames. You can then just export the project as a spritesheet as normal. I'm not sure if it's easily scriptable though, I suspect not.
You can also easily write something yourself with Love2D, simply load each file, create a FrameBuffer that is the right size (for a single row horizontal sheet the width of a frame multiplied by the number of frames by the height of a frame), render them in order side by side then you can get the image data from the FrameBuffer and save that using https://www.love2d.org/wiki/ImageData:encode
Edit: I meant to say Canvas. FrameBuffer is gone.
You can also easily write something yourself with Love2D, simply load each file, create a FrameBuffer that is the right size (for a single row horizontal sheet the width of a frame multiplied by the number of frames by the height of a frame), render them in order side by side then you can get the image data from the FrameBuffer and save that using https://www.love2d.org/wiki/ImageData:encode
Edit: I meant to say Canvas. FrameBuffer is gone.
Last edited by marclurr on Mon Jun 06, 2022 8:06 am, edited 1 time in total.
-
- Party member
- Posts: 559
- Joined: Wed Oct 05, 2016 11:53 am
Re: Several images to spritesheet
I personally use TexturePacker, which has a GUI as well as command line tools for automation purposes, basically creating the spritesheet file, as well as an accompanying file specifying the quads there-in. It doesn't come with a löve2d exporter right out of the box, but it's relatively easy to write one to your specifications.
For a free alternative, there's ImageMagick. Additionally, if you take a gander at the awesome-love2d page, there's a couple texture atlas packers listed (under "Drawing").
For a free alternative, there's ImageMagick. Additionally, if you take a gander at the awesome-love2d page, there's a couple texture atlas packers listed (under "Drawing").
Re: Several images to spritesheet
I have the script for ImageMagick:
best_spritesheet_8x8.bat (it packs to spritesheet 8x8, multiple files if more than 64 sprites)
It crops the unneeded alpha too.
best_spritesheet_8x8.bat (it packs to spritesheet 8x8, multiple files if more than 64 sprites)
Code: Select all
magick "input/*.png" -background none ^
( -clone 0--1 -layers merge ^
-set option:cropper "%%[@]" +delete ) ^
-crop %%[cropper] +repage ^
MIFF:- | magick montage MIFF:- -background none ^
-tile 8x8 -geometry +0+0 best_spritesheet_8x8.png
pause
Who is online
Users browsing this forum: No registered users and 3 guests