fmw42 wrote:Thanks. I see the label now in the verbose info for tmp1.png and I re-read the montage docs to see that it uses any label in the image. I never knew that using label:"something" would also put the label in the label field of the resulting image file. Learned something new today. Thanks again.
Not all image formats support 'label' meta-data. and some support 'comment' meta-data.
See Labeling Montage Images
http://www.imagemagick.org/Usage/montage/#label
However I did just come across a actual BUG.
In montage you can use
-label or
-set label to create a new label based in the input image. For example using this test image...
Code: Select all
convert rose: -set label 'rose' -set comment '(is a rose)' rose_with_metadata.png
Montage can show the label (the default)
Code: Select all
montage rose_with_metadata.png -geometry +1+1 rose_label.png

It can show the comment
Code: Select all
montage rose_with_metadata.png -set label '%c' -geometry +1+1 rose_comment.png

But if can not use a 'label escape' to show the label
Code: Select all
montage rose_with_metadata.png -set label '%l' -geometry +1+1 rose_label_escape.png
This means you can not label an image with both its input label and its comment.
Code: Select all
montage rose_with_metadata.png -set label '%l\n%c' -geometry +1+1 rose_label_comment.png
It seems like IM is destorying the 'old' label before applying the format escape sequences.
Cristy reports the above problem with -set label '%l' is now fixed in latest SVN, (for the next ImageMagick 6.6.2-2 release)
However in finding a work around for this bug I found that MIFF file format can save ANY meta-data you like to specify!
For example...
Code: Select all
convert rose: -set xyzzy 'Xyzzy' miff:- |
montage - -set label '%[xyzzy]' -geometry +1+1 rose_xyzzy.png
I actually use this technique in my new script
kernel2image whcih I use to generate kernel images for IM examples
Morphology and Convolution pages
http://www.imagemagick.org/Usage/morphology/
(still under development).
Caution however is recommended with this as some of these are calculated escapes, and not extracted from image meta-data.
ASIDE: Set items without a "options:" prefix are known as "Image Properties" internally and in "identify -verbose", and are saved in MIFF. While items set with "options:" are "Image Attributes" and are generally used for expert or 'out-of-band' options used by various library options.