Page 1 of 1
Gif to sprite sheet?
Posted: Wed Apr 12, 2017 1:11 am
by Bizobinator
How do I turn a gif into a sprite sheet? Or, rather, a series of images into a sprite sheet (instead of using Blender and the Python script)?
Re: Gif to sprite sheet?
Posted: Wed Apr 12, 2017 7:20 am
by darkfrei
Bizobinator wrote:How do I turn a gif into a sprite sheet? Or, rather, a series of images into a sprite sheet (instead of using Blender and the Python script)?
https://www.imagemagick.org/script/comm ... essing.php
You can read more than one image from a sequence with a frame range. For example, you can extract the first four frames of an image sequence:
Code: Select all
magick 'images.gif[0-3]' images.mng
Optionally, use an embedded formatting character to write a sequential image list. Suppose our output filename is
and our image list includes 3 images.
Re: Gif to sprite sheet?
Posted: Wed Apr 12, 2017 8:00 am
by bobingabout
I do it by hand.
I also use an obscure old piece of software called Paint shop pro, so, if I described exactly, features I use might not exist in your program.
Basically... I find out what the minimum size the sprite needs to be so the entire thing fits in an un-moving rectangle, then that's my size
I then set a grid to the size of this grid.
Count how many sprites there are, and figure out their arangements. if it needs to be 8 frames wide, I create a blank sheet which is 8 times the width of a sprite wide. Similar calculation for height.
then... pick up the first image, drop it in the top left corner. pick up the second, and drop it in the space to it's right... making sure the top left pixel lines up to the top left pixel in my grind. The grid is purely part of the GUI, so isn't saved when I save the image.
and so on.
Re: Gif to sprite sheet?
Posted: Sun Apr 23, 2017 7:28 pm
by Bizobinator
bobingabout wrote:I do it by hand.
I also use an obscure old piece of software called Paint shop pro, so, if I described exactly, features I use might not exist in your program.
Basically... I find out what the minimum size the sprite needs to be so the entire thing fits in an un-moving rectangle, then that's my size
I then set a grid to the size of this grid.
Count how many sprites there are, and figure out their arangements. if it needs to be 8 frames wide, I create a blank sheet which is 8 times the width of a sprite wide. Similar calculation for height.
then... pick up the first image, drop it in the top left corner. pick up the second, and drop it in the space to it's right... making sure the top left pixel lines up to the top left pixel in my grind. The grid is purely part of the GUI, so isn't saved when I save the image.
and so on.
I'm trying out this method, but I've had a snag (again with the picture out of bounds).
Code: Select all
filename = "__mlg_factorio__/graphics/air-horn-action.png",
priority = "extra-high",
width = 640,
height = 640,
frame_count = 100,
line_length = 10,
animation_speed = 1,
Are the width & height parameters meant to be per each individual frame, or are they for the total sprite sheet?
The sprite sheet I'm using is 10x10 chunks, with each sprite meant to be 64x64.
Re: Gif to sprite sheet?
Posted: Sun Apr 23, 2017 8:11 pm
by Arch666Angel
it's width and height per frame