Hello everybody out there using ImageMagick,
Is it possible to have an annotation with 1 part in green followed by another one in red?
The spacing of letters should not be affected as when using the +x+y attribute.
Thanks in advance for your help.
Differently colored annotations
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Differently colored annotations
I don't know exactly what you want. See http://www.imagemagick.org/Usage/annotating/ for many examples. If that doesn't help, show an example of what you want to do.
snibgo's IM pages: im.snibgo.com
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Differently colored annotations
Using "ImageMagick 6.9.3-6 Q16 x64" I've achieved varying degrees of success using some of the following. Here's an idea using "label"...bourbaki wrote:Is it possible to have an annotation with 1 part in green followed by another one in red?
The spacing of letters should not be affected as when using the +x+y attribute.
Code: Select all
convert ^
-gravity northwest ^
-pointsize 48 ^
-fill black ^
label:"The blue word." ^
-fill blue ^
label:"The blue" ^
-fill black ^
label:"The" ^
-layers merge ^
-size 600x100 ^
canvas:white ^
+swap ^
-gravity center ^
-composite ^
output1.png
Code: Select all
convert ^
-size 600x100 ^
canvas:white ^
-gravity northwest ^
-pointsize 48 ^
-fill black ^
-annotate +0+0 "The blue word." ^
-fill blue ^
-annotate +0+0 "The blue" ^
-fill black ^
-annotate +0+0 "The" ^
output2.png
Code: Select all
convert ^
-size 600x100 ^
-gravity center ^
-pointsize 48 ^
pango:"The <span foreground='blue'>blue</span> word." ^
output3.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Differently colored annotations
Another method for GeeMack's "The blue word" is to make a label of each word (plus trailing space), and "+append".
Code: Select all
%IM%convert ^
-pointsize 48 ^
-fill black ^
label:"The " ^
-fill blue ^
label:"blue " ^
-fill black ^
label:"word." ^
+append ^
output4.png
snibgo's IM pages: im.snibgo.com
Re: Differently colored annotations
Thanks a lot for your answers, which help me a lot.
Great forum, great support, great software.
Great forum, great support, great software.