Page 1 of 1

Batch Label / Annotating Images

Posted: 2013-10-17T15:37:02-07:00
by robocop
I have a directory and several sub-directories below the main directory with thousands of images.

I would like to apply a simple text label to all the images at once.

The Annotating Images / Labeling an Image command works perfectly as I have tested it on a few of my images:
http://www.imagemagick.org/Usage/annotating/#annotating

Code: Select all

convert dragon.gif   -background Khaki  label:'Faerie Dragon' \
          -gravity Center -append    anno_label.jpg
I would just like to know how can I do it all at once in batch since the label will be the same for all images

Any advise would be greatly appreciated.

Thank you in advance

Re: Batch Label / Annotating Images

Posted: 2013-10-17T15:43:48-07:00
by fmw42
create your label as an transparent background image, then use mogrify to apply it to every image in a given folder. Note it does not do subfolders.

see
http://www.imagemagick.org/Usage/basics/#mogrify
http://www.imagemagick.org/Usage/basics ... fy_compose

Otherwise, you need to create a script to loop over every directory and every subdirectory and apply the label. With the above, you have to repeat the mogrify only for each distinct subdirectory.

Re: Batch Label / Annotating Images

Posted: 2013-10-17T16:09:29-07:00
by robocop
Thanks fmw42 for your advise.

I'll go ahead and make the the label as a transparent background image and use the mogrify command.

Cheers

Re: Batch Label / Annotating Images

Posted: 2013-10-17T17:11:14-07:00
by fmw42
robocop wrote:Thanks fmw42 for your advise.

I'll go ahead and make the the label as a transparent background image and use the mogrify command.

Cheers

I recommend that you use the -path option to another empty directory to be sure you do not overwrite your originals with bad processing or errors