Handling bad color names/numbers..

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
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Handling bad color names/numbers..

Post by dognose »

I'm trying to find the best way to deal with bad colors being input..

For example:
# convert -fill darkgold label:Test test.gif
convert: unable to open image 'darkgold': No such file or directory @ error/blob.c/OpenBlob/3497.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.

or
convert -fill '#00000' label:Test test.gif
convert: unable to open image '#00000': No such file or directory @ error/blob.c/OpenBlob/3497.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/556.

it seems that fill can be a color or image file?

Can I tell IM to expect a color? Or, any suggestions?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Handling bad color names/numbers..

Post by fmw42 »

Code: Select all

convert -fill "#000000" label:test test.gif
works for me. Note that you used 5 zeros and you need 6 zeros.

There is no darkgold at https://imagemagick.org/script/color.php. But there is a dark goldenrod
Post Reply