Special Format Characters
The Magick::Image methods Image.html#annotateannotate , Image.html#drawdraw , Image.html#labellabel , and the template function montageImages support special format characters contained in the argument text. These format characters work similar to C's printf. Whenever a format character appears in the text, it is replaced with the equivalent attribute text. The available format characters are shown in the following table.
Format Characters
Format Character
Description
%b
file size
%d
directory
%e
filename extension
%f
filename
%h
height
%m
magick (e.g GIF)
%p
page number
%s
scene number
%t
top of filename
%w
width
%x
x resolution
%y
y resolution
\n
newline
\r
carriage return
