Page 1 of 1
Add date to photos
Posted: 2012-01-23T04:48:38-07:00
by Elapido
Hello. Could you tell me how to add text in the bottom right corner of a series of jpgs indicating the date of the photo (the date in which it was taken, or the date in which the file was created). I'd like white small font, with a black outline. Is this possible? Thanx.
Re: Add date to photos
Posted: 2012-01-23T08:36:53-07:00
by Bonzo
Yes it can be done and I think Anthony posted a while back about how to get the date into the command with resorting to reading it into a variable.
Otherwise get the date into a variable using identify and use that in the command; as you do not say how you will be using the code here is a batch script version:
Code: Select all
:: Use the ImageMagick identify command to set the variable DateTime to equal the Date and Time from the photo EXIF data
FOR /F %%x IN ('identify -format "%%[EXIF:DateTime]" %INPUTFILE%') DO SET DateTime=%%x
:: Add the date the photo was taken to the image
convert %1 -pointsize 20 -fill black -gravity northwest ^
-annotate +0+0 "Date: %DateTime%" "%~p1date_%~n1.jpg"
Re: Add date to photos
Posted: 2012-01-23T09:40:17-07:00
by Elapido
Thankyou. What's the difference between that script and this one I've found?
BTW, in this example, the modified files are stored in a different folder but the names are wrong and have no extension. How can I fix it?
convert fotosin\*.jpg -font Arial -pointsize 32 -fill white -annotate +30+50 %[exif:DateTimeOriginal] \fotosout