Page 1 of 1

Contact sheet items and labels

Posted: 2015-12-12T03:38:04-07:00
by Mahroun
Hello everyone,

Is it possible to control items order and their labels when creating a contact sheet?
Right now I have the following command:

Code: Select all

montage.exe -gravity south -tile %tile% -verbose -label "%t" -quality 100 -define jpeg:size=200x200 -geometry 200x200+200+100> -auto-orient "D:\Pictures\CS\*.png" "D:\Pictures\CS\CS.png"
It loops "D:\Pictures\CS\" and creates a contact sheet of PNGs inside that folder and give each picture its name as a label, but what I need is a command to send to montage that includes items order and their labels and not their names.

Imaginary example:

Code: Select all

montage.exe "D:\Pictures\CS\zebra.png" -label "a zebra" "D:\Pictures\CS\snake.png" -label "a snake"...
TIA

Re: Contact sheet items and labels

Posted: 2015-12-12T11:20:15-07:00
by fmw42
You can label each image first and then send the results to montage. See http://www.imagemagick.org/Usage/annotating/#annotating or you can write the label information into the meta data using convert image -set label "yourlabel" result and then in montage use -label "%l" to extract that label rather than the filename. Or you can do the same, but put the label information in the comment section of the meta data with -set comment "yourcomment" and use "%c" in montage. See http://www.imagemagick.org/script/escape.php and http://www.imagemagick.org/script/comma ... ns.php#set

Example:

Code: Select all

convert rose: -set comment "testing" -set label "test" rose.png

Code: Select all

identify -verbose rose.png

 Properties:
    comment: testing
     label: test
So you could do both in one command (unix syntax):

Code: Select all

convert \
\( image1 -set comment "comment1" \) \
\( image2 -set comment "comment2" \) \
...
\( imageN -set comment "commentN" \) \
miff:- | montage -label "%c" - -tile ... result
For unix syntax, see http://www.imagemagick.org/Usage/windows/. Basically replace end of line \ with ^ and remove \ from before ( and before )

Re: Contact sheet items and labels

Posted: 2015-12-13T19:07:48-07:00
by Mahroun
Thank you so much :)

One question though, how do I control the space/margin between the label and the image?

Re: Contact sheet items and labels

Posted: 2015-12-13T19:51:51-07:00
by fmw42
I do not think you can do it in montage, but you can do something like this by using -splice in the convert beforehand. See http://www.imagemagick.org/Usage/crop/#splice

Code: Select all

convert \
\( image1 -set comment "comment1" -background white -gravity south -splice 0x5 \) \
\( image2 -set comment "comment2" -background white -gravity south -splice 0x5 \) \
...
\( imageN -set comment "commentN" -background white -gravity south -splice 0x5 \) \
miff:- | montage -label "%c" - -background white -tile ... result