Getting the data is one step, and done two different ways.
One is using 'percent escapes'
The other is to extract the information in an external script using "identify" or some other tool (as previously mentioned)
Using 'percent escapes' has the advantage that you can immediately -annotate the information directly (as is) on the image
An external script method mean you can use the scripting language or other text processing tools to cut-up, and reformat the string exactly how you want it, then you can annotate that onto the image using a second image call.
The first is faster as it is all in one command, the second more versatile.
The information you specified can be extracted using a 'globbing' expression (case insensitive) in the percent escape.. For example... Any EXIF tag that has GPS in the tag name...
Code: Select all
identify -format "%[EXIF:*GPS*]" image.jpg
To annotate it directly (nothing fancy using default font)
Code: Select all
convert image.jpg -gravity NorthWest -annotate 0 "%[EXIF:*GPS*]" new_image.jpg
How you 'annotate' the information onto the image is the second matter, that you have not really addressed.
Do you want plain text, like the above, or something more fancy?
Do you want to append the information above or below (perhaps rotated on the side) on the image?
Do you want to add a 'dimmed box' or blurred background halo around the text to ensure it is always readable regardless of how light or dark the image is?
Do you want it to fit in a specific sized area, auto-size the font to fill that area, or word wrapped to the width of the image?
Etc Etc Etc...
There are lots and lots of possibilities you probably never even thought about.
This is all dealt in a whole section of IM examples, Annotating Images
Which is combined with the previous section, Compound Fonts,