Adding an image’s creation timestamp as a watermark
Adds the creation timestamp of the image (as noted in the exif data) as a watermark on the bottom right of the image, with a black outline and white text.
img=your-image.jpeg
magick "$img" -font DejaVu-Sans -gravity SouthEast -pointsize 64 \
-stroke 'black' -strokewidth 5 -annotate +30+30 %[exif:DateTimeOriginal] \
-stroke none -fill white -annotate +30+30 %[exif:DateTimeOriginal] \
"${img/.jpeg/}_time.jpeg";
Sometimes the date is shown as 2026:05:01.
Use identify to read the exif data and modify it to your needs.
This changes it from 2026:05:01 07:05:11 to 2026-05-01 07:05:11
date=$(identify -format %[exif:DateTimeOriginal] "$img" | awk -F'[ :]' '{print $1"-"$2"-"$3 " " $4":"$5":"$6}')