2

I'm working on terrain for a game, and the output I chose in the terrain generation software is 256 1024x1024 tiles that I need to combine into one big .png.

I've tried running some image stitching applications through WINE with no success. (They all seem to focus on panoramas.) I've had success with this type of thing before using ImageMagick, but when trying to use Montage, it doesn't sort the tiles and they have white borders between them.

The tiles each have a X and Z coordinate in their name, in this case output_x00_y00.png through output_x15_y15.png.

How can I stitch these files?

1 Answer 1

1

The command line is interpreted from left to right and on this case we would like to run the Y coordinate before the X, the solution is doing it by steps. Firstly we join all the columns, secondly the rows.

#Join the columns
for x in {01..15}; do
  montage output_x${x}_y[0-1][0-9].png \
  -tile 1x15 -geometry +0+0 /tmp/result_${x}.png
done
#Join the rows
montage /tmp/result_[0-1].jpg -tile 15x1 -geometry +0+0 result.png

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.