Convert annotations w/shadows to labels

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert annotations w/shadows to labels

Post by fmw42 »

here is the guts of a recent script I wrote to find the closest color in an image to a reference color, then create two labeled swatches appended side-by-side. See nearest color at http://www.fmwconcepts.com/imagemagick/index.html

This is the part that creates the labeled and appended swatches.


convert \
\( -background "$rcolor" \
-fill $labelcolor -font $fontname -pointsize $point \
-gravity northwest label:"Reference Color:\n\n\n$rcolor" \) \
\( -background "$mcolor" \
-fill $labelcolor -font $fontname -pointsize $point \
-gravity northwest label:"Nearest Color:\n\n\n$mcolor" \) \
+append $outfile


This should get you started in the right direction.

see Anthony's excellent pages (esp text to image) at http://www.imagemagick.org/Usage/
Post Reply