Reputation: 924
I want to merge 9 images using imagemagicks convert into 3x3 tiles with a 1px spacing between the tiles. In my other, bigger version of the resulting image I have a spacing of 2px. To achieve this I've added a border of 1px to every image, and after the image has been created I'm using crop to strip the outer border.
Is there an easy way to get just 1px spacing between the tiles, unfortunately a border of 0.5px doesn't work.
The best.
Upvotes: 0
Views: 1045
Reputation: 747
Your method is similar to that used by the montage
program, which has the same limitation that you found. In order to get 1px spacing between tiles, you will need a little bit more involved of a convert
command. The method used here first builds the rows of the resulting image, then sticks them together, then cuts out border pixels that we don't want.
convert \( 0.png 1.png 2.png -splice 1x +append \) \
\( 3.png 4.png 5.png -splice 1x +append \) \
\( 6.png 7.png 8.png -splice 1x +append \) \
-splice x1 -append -chop 1x1 \
out.png
In more detail:
Hope this helps.
Upvotes: 1