Re: splice (adding tile gridding gaps)
Posted: 2012-05-23T22:46:30-07:00
No need for the montage, and default gravity will be fine...fmw42 wrote: convert $infile -crop ${xspace}x${yspace} +repage \
-background $vcolor -gravity west -splice ${thickness}x0 \
-background $hcolor -gravity north -splice 0x${thickness} \
miff:- | montage - -geometry +0+0 -tile ${nx}x${ny} ${inname}_grid_expand.jpg
In fact you do not even need to know number of tiles it will create
Code: Select all
convert $infile \
-crop ${xspace}x0 +repage -background $vcolor -splice ${thickness}x0 +append \
-crop 0x${yspace} +repage -background $hcolor -splice 0x${thickness} -append \
${inname}_grid_expand.jpg
The problem however is that this can do a LOT of image creation, copying and processing. The smaller the tile, the more extra 'house-keeping' processing it needs.
The -splice operator gets around that by creating one destination image, and then copying source pixels with appropriate gaps to that image. Though that is best done at pixel level. FX could do it that way, but it would be complex and slow.
Added to IM Examples, Transforms, Spacing out Tiles (when image above appears)
http://www.imagemagick.org/Usage/transf ... cing_tiles