Page 1 of 1

Trying to add shadowed text to an existing image

Posted: 2019-09-19T09:22:20-07:00
by clownpleco
I pulled this exact command out of the ImageMagick doc and having no luck:

convert -background none -stroke black -fill white \
-font Candice -pointsize 48 label:'Sept ' \
\( +clone -background navy -shadow 80x3+3+3 \) \
-background none -compose DstOver -flatten base-t0.png

convert: not authorized `Sept ' @ error/constitute.c/ReadImage/454.
convert: image sequence is required `+clone' @ error/convert.c/ConvertImageCommand/935

centos 7
Version: ImageMagick 6.7.8-9 2019-02-01 Q16 http://www.imagemagick.org

Re: Trying to add shadowed text to an existing image

Posted: 2019-09-19T09:42:25-07:00
by fmw42
Do you have the Candice font installed and in your type.xml file? If not, install it and replace Candice with the path to your candice.ttf file. Does that make it work? That worked for me on ImageMagick 6.7.8.9 Q16 Mac OSX. If that does not work, then your Centos version of ImageMagick is buggy. Note that Linux distributions do not always patch completely. Often they only patch for security. So your version might not be good. Does

Code: Select all

convert -version
work OK?

What about

Code: Select all

convert logo: logo.png
What about

Code: Select all

convert -background red -stroke black -fill white -font Arial -pointsize 48 label:"Sept" test.gif

Re: Trying to add shadowed text to an existing image

Posted: 2019-09-19T11:42:43-07:00
by clownpleco
convert -version
Version: ImageMagick 6.7.8-9 2019-02-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

convert logo: logo.png
Worked fine.

Last command failed.

Note - I removed -font completely as to use the default font.

Not sure if this helps, but this works
convert base-t0.png -gravity south -pointsize 40 \
-stroke '#000C' -strokewidth 2 -annotate 0 'September - November' \
-stroke none -fill white -annotate 0 'September - November' \
test.png

I just need the shadow added.

Re: Trying to add shadowed text to an existing image

Posted: 2019-09-19T14:24:28-07:00
by fmw42
Try specifying -font path_to/fontfile.ttf. Be sure whatever font file you use does exist. Sounds like your type.xml file is empty, so that named fonts do not work. But font files should work if the font exists.

Re: Trying to add shadowed text to an existing image

Posted: 2019-09-19T14:55:45-07:00
by clownpleco
I'm not worried about the font issue (that appears to be an easy fix). Problem is I could not get the command to work at all. See error message at the top of the thread.
After a google search, I did find that updating policy.xml for label helped. I'm now able to make an image with just the annotation. I'll probably just combine the new image with the previous base image. I was just hoping I could have done it with one command.

Re: Trying to add shadowed text to an existing image

Posted: 2019-09-19T16:46:01-07:00
by fmw42
Sorry, I do not know what might be the issue other than a buggy version of ImageMagick. It worked fine for me on my Mac using the same ImageMagick version. Try changing single quotes to double quotes. Also try changing -annotate 0 to -annotate +0+0