0

My purpose is to insert a text (same words + sequenced number) into many pictures (may more than thousands), can I implement this using Mac or Windows? Thank you for the suggestions.

Leo
  • 11
  • 5
  • I am thinking if it possible to use terminal to solve it? – Leo Jun 07 '15 at 01:37
  • Could you be more specific as to how it should look? Would the text be on top of the image thereby obscuring part of it? Or would the picture be increased in say height so that the text doesn't obscure the original image but its dimension increase? Does the text go at the top, the bottom, the middle? Are the pictures all the same size? – Mark Setchell Jun 11 '15 at 05:56

2 Answers2

0

Using imagemagick software to insert text by command annotate, and write a loop in a script and then run it. This can be used to add a sequence of logical number + text into a sequence of pictures.

Leo
  • 11
  • 5
0

I would use OS X, and install ImageMagick using homebrew. First go to the homebrew website, and copy and paste the one-line installation script to install homebrew. Then install ImageMagick, like this:

brew install imagemagick

Then you can read this page and this page, that shows you a thousand ways to label pictures.

Now, use the Finder to make a new directory and copy some images into there to play around with without damaging your proper, original images. Say you make a directory called play in your login directory.

Then start Terminal, and type

cd play

to go to the new directory. Now you can make a script, something like this and save it as labelimages:

#!/bin/bash
i=0
for f in *.jpg; do
   echo Labelling $f, counter=$i
   convert "$f" -fill white -undercolor '#00000080' -pointsize 36 -gravity South -annotate +0+5 " Image - $i " "$f"
   ((i++))
done

Then you need to make that executable, just once, by typing

chmod +x labelimages

Now you can label all images in the current folder by typing

./labelimages

and they will come out like this:

enter image description here

enter image description here

You may need to install fonts, if so, see my post here.

Community
  • 1
  • 1
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432