Search code examples
imagemagickoverlaytiling

Imagemagick tiling with annotation


I am splitting a big image with:

convert input.jpg -crop 2256x3043 +repage +adjoin output-%02d.jpg

How can I annotate the tile number at the center of each image?

Thanks.


Solution

  • OK, I finally found the solution:

    convert input.jpg \
            -crop 2256x3043 +repage +adjoin \
            -pointsize 300 -gravity Center -annotate 0 "%[p]" \
            output-%02d.jpg
    

    This will split the images in tiles that are 2256x3043 big and write at the center the number of the tile (starting from 0) with a big sized font. I got it using Imagemagick escape property %p, defined as:

    index of image in current image list