0
\$\begingroup\$

It might be more of a graphics software question - but, well, it concerns game development.

I'm using some free spritesheets found in the web, and basically one of the characters seems slightly scaled, causing it to poorly fit the others. I'm looking for a quick way to scale the individual images in this particular spritesheet, while keeping the original spritesheet "bounds" (sprites positions, sizes of individual images). In other words, I want to scale a whole bunch of separate image parts, without scaling the image as a whole (and without spending hours on it).

Wouldn't mind a solution using GIMP or a specific spritesheet manager application.

\$\endgroup\$
7
  • \$\begingroup\$ What's your actual question? Note that "which technology to use" questions are off topic here. \$\endgroup\$
    – House
    Commented May 8, 2014 at 18:12
  • \$\begingroup\$ How regular is your data ? are all sprite arranged in a regular grid ? Are the sprite expanding their width as needed in a non-grid comic book panel fashion ? are sprite tightly packed without any uniformity ? \$\endgroup\$
    – Lærne
    Commented May 8, 2014 at 18:34
  • \$\begingroup\$ It's a regular grid, every image is 128x128. \$\endgroup\$
    – Czyzby
    Commented May 8, 2014 at 19:25
  • \$\begingroup\$ In most engines/frameworks, you can scale the sprite that's using the sub-rect of the texture before rendering the sprite. Might be easier than modifying the sheet itself. \$\endgroup\$
    – Chaosed0
    Commented May 8, 2014 at 19:44
  • \$\begingroup\$ Not exactly. While it is easy to do in code, I'd rather edit the spritesheet itself. Since I'm not using only one sprite and every other one is fine, I don't feel like making an exception for just one kind of images and put a lot of unnecessary "ifs". \$\endgroup\$
    – Czyzby
    Commented May 8, 2014 at 19:53

1 Answer 1

0
\$\begingroup\$

OK, I've actually figured it out after looking at some tools available. I guess I can post my solution in case anyone ever encounters a similar problem:

1. Scale the whole spritesheet to your preferred size. GIMP is a good tool for that, I guess.
2. Cut the spritesheet into separate (smaller than original) sprites. I've done it with http://imagesplitter.net/ - it's pretty easy and fast to use.
3. Using the ImageMagick tool, make another spritesheet from the scaled sprites. The command for this would be something like:

montage *.png -tile XxY -geometry WIDTHxHEIGHT+XOFFSET+YOFFSET -background transparent NAME

Where: X is the number of columns, Y is the number of rows, WIDTH is the width of a new single sprite, HEIGHT is the height of a new single sprite, XOFFSET is half of the amount of pixels needed to make the new sprite match the original width, YOFFSET is half of the amount of pixels needed to make the new sprite match the original height and NAME is the name of the file of the new spritesheet. You calculate offsets with this formula: Offset = (OldSize - NewSize) / 2. For example, if your old size was 128/128px and after scaling it's 110/110px, you'd have to enter -geometry 110x110+9+9.
4. While you might be already done by this step, sometimes you may want to move the sprites a little (they will be centered and basically they will "start" a little higher, so unless you're making a top-down game, the sprites will probably appear to be floating in the air). Again, GIMP comes in handy: select the whole image and move it down a few pixels - that should do it.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .