5
\$\begingroup\$

I'm currently was working on a texture pack for minecraft (but this question is not restricted to that). All terrain textures are squared and stored in one big terrain.png. (FYI that's from Glimmar's Steampunk pack). I'd like to store each texture in an individual file and have same automated process pack them into the terrain.png later on (maybe leaving the not yet created ones their default). At the moment I do this manually by copy/pasting them with gimp (at least the raster helps a lot here) but I'd really like to do this automatically. Basically this seems to be what happens behind the scenes of the Painterly pack customizer already. So,

Is there a tool that replaces some squarespolygons* in a png file with new ones (also png), the position of which might be configured in a separate file?

edit Some automated resizing for different resolution versions might be nice as well...

edit2 Meanwhile I learned that "position [...] configured in a separate file" means atlas, and since the question originated from Minecraft texture packs (IIRC the format got changed meanwhile), the ideal tool would allow for using an existing atlas to replace some of the tiles


*) might as well ask the general case

\$\endgroup\$
3
\$\begingroup\$

My favorite spritesheet packer is Texture Packer: http://www.texturepacker.com/

There's a free version that works pretty well, but the paid version adds features like resizing.

Another option is Zwoptex: http://zwoptexapp.com/

|improve this answer|||||
\$\endgroup\$
1
\$\begingroup\$

Another option is crunch which is a free open source cli tool originally designed for Celeste

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Looks good, thanks. Is there any way to reuse an existing atlas? \$\endgroup\$ – Tobias Kienzler Apr 25 '18 at 7:37
  • \$\begingroup\$ Can you clarify what you mean by reusing an atlas? \$\endgroup\$ – Secret Apr 25 '18 at 8:30
  • \$\begingroup\$ I mean given an existing atlas from a previous crunching, is it possible to reuse that atlas so that the updated textures will be in the same place again and not in some pseudo randomized positions? \$\endgroup\$ – Tobias Kienzler Apr 25 '18 at 8:32
  • \$\begingroup\$ I don't think it's possible, but why would you need to? The data should be defined in the atlas file (json/xml) so having sprites on different positions shouldn't be a problem. In fact, it's best to put it on new positions to ensure everything is placed on the best possible position in the new texture dimension (if it changes). \$\endgroup\$ – Secret Apr 25 '18 at 8:47
  • 1
    \$\begingroup\$ I agree, and it makes perfectly sense if your game properly reads the atlas. But in the case of (old versions of) Minecraft, the atlas is (or at least was) hard-coded, therefore my question. \$\endgroup\$ – Tobias Kienzler Apr 25 '18 at 8:52
1
\$\begingroup\$

Try out Nick Gravelyn's Sprite Sheet Packer. I don't know if you can control scale with it, but you can easily automate that in script with ImageMagick

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Unfortunately, ImageMagick will only pack sprites if they are all the same size... \$\endgroup\$ – Daniel Blezek Apr 27 '11 at 19:00
  • 1
    \$\begingroup\$ I should have clarified and mentioned that I intended ImageMagick to be a pre- and post- packer tool. The idea would be to do any per-sprite pre-scaling with ImageMagick, run Sprite Sheet Packer, and then run ImageMagick again on teh final results to shrink the output to your desired size if necessary. \$\endgroup\$ – michael.bartnett Apr 27 '11 at 20:47
  • \$\begingroup\$ the packer looks nice for writing my own game (so +1) since it outputs the dynamically calculated sprite positions, but since they are already defined by Notch, I need a tool to pack in customizable positions \$\endgroup\$ – Tobias Kienzler May 3 '11 at 16:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.