Montage labels - way to alternate color?

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
WokYai
Posts: 1
Joined: 2011-08-28T01:41:18-07:00
Authentication code: 8675308

Montage labels - way to alternate color?

Post by WokYai »

Hi,

I'm using montage to create something like contact sheets of images, which I label using '-label %t\n%wx%h'. Occasionally the filenames are long enough to cause adjacent labels to come close enough that they nearly overlap. Is there a way to alternate the color of the text such that adjacent labels aren't the same color? I naively tried inserting '-fill white' and '-fill yellow' between the source images, but that just resulted in all labels being whatever color was specified last.

Thanks for any help.

Jason
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Montage labels - way to alternate color?

Post by fmw42 »

Can you post a link to an example result you currently have and to your exact command line?

One thought, though I can see some potential issues, might be to make two montages with alternate skipped images using a null: for place holders. Do it on a transparent background. Then composite the two montages together to fill in and flatten against whatever background color you want. Don't know it this will cause trouble or not with long text string filenames or not.

Also note that you can space out the images using -geometry. That may be a better way to just keep the text from nearly overlapping.

See http://www.imagemagick.org/Usage/montag ... ry_spacing
Post Reply