Annotate in all CAPS

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Videomajk
Posts: 14
Joined: 2017-02-18T07:46:04-07:00
Authentication code: 1151

Annotate in all CAPS

Post by Videomajk »

Hello

I want to extract a piece of IPTC metadata from an image and use annotate to write it onto the image. I use the following command:

Code: Select all

-font Bitstream-Arrus-Italic-BT -pointsize 14 -annotate 0x0+0+20 "%[IPTC:2:92]"
The problem is that I want to type the ITPC value in all caps, ragardles of how the value is typed in the image metadata. Is there a way to do this?

IM7 on Windows 10
------------------------------------------------------------------------
Imagemagick v 7.0.4 | Windows 10
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Annotate in all CAPS

Post by snibgo »

Not with just ImageMagick, no. You can extract the metadata, capitalise with another program, and feed that back to IM.
snibgo's IM pages: im.snibgo.com
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Annotate in all CAPS

Post by GeeMack »

Videomajk wrote: 2017-03-10T15:57:53-07:00The problem is that I want to type the ITPC value in all caps, ragardles of how the value is typed in the image metadata. Is there a way to do this?
IM doesn't have a way to do that, but... There are several fonts that are all caps. Most seem to have at least small differences between the upper and lower case version of each character, but depending on your need, that might not be an issue. There are also various font design and editing programs, some of which are supposed to be fairly easy to use. Constructing your own font by using the same set of characters for both upper and lower case might be an option.

Keep in mind that the font you use doesn't have to be actually installed on your system to work in IM. You can simply call the font file by name into your command using something like "... -font "path/to/the_font.ttf" ...".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Annotate in all CAPS

Post by fmw42 »

In Unix, you can pipe the output of your EXIF or IPTC data to sed to change the text to all caps in line. I do not know if that works in Windows. Or extract the text data, convert to all caps and save to a variable and then use the variable to annotate your image. So something like

Code: Select all

cap_text=$( convert image -format "%[IPTC::2:92]" info: | sed 's/[a-z]/[A-Z]/g' )
Videomajk
Posts: 14
Joined: 2017-02-18T07:46:04-07:00
Authentication code: 1151

Re: Annotate in all CAPS

Post by Videomajk »

Thanks everyone.
I think I'll try to find a font with an all caps style.
------------------------------------------------------------------------
Imagemagick v 7.0.4 | Windows 10
Post Reply