white text on gray background problem

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
gildir

white text on gray background problem

Post by gildir »

I'm trying to draw white text on a gray background. So far, whenever I do this, I get gray text instead of white. The same command works perfectly on a bright green or bright blue background, though on a black background the text disappears completely. Here's the command I'm using:

convert -quality 100 -draw " fill cmyk(0,0,0,0) font 'SabonLT Bold.TTF' font-weight 400 gravity North rotate 0 font-size 38 text 0,55 'test,'" "07-07-23-03-23.jpg" "07-07-23-03-23.jpg"

Any help would be appreciated. I've fiddled around with some commands which sounded like they might work (-alpha off, -opaque white) and I've tried specifying the color as rgb and rgba, but I'm very new at this and I may be on the completely wrong track.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: white text on gray background problem

Post by anthony »

gildir wrote:I'm trying to draw white text on a gray background. So far, whenever I do this, I get gray text instead of white. The same command works perfectly on a bright green or bright blue background, though on a black background the text disappears completely. Here's the command I'm using:

convert -quality 100 -draw " fill cmyk(0,0,0,0) font 'SabonLT Bold.TTF' font-weight 400 gravity North rotate 0 font-size 38 text 0,55 'test,'" "07-07-23-03-23.jpg" "07-07-23-03-23.jpg"

Any help would be appreciated. I've fiddled around with some commands which sounded like they might work (-alpha off, -opaque white) and I've tried specifying the color as rgb and rgba, but I'm very new at this and I may be on the completely wrong track.
Draw does not draw in CMYK, only RGB. that would be the cause of the problem.

better to use -annotate instead in any case!

See
http://www.imagemagick.org/Usage/text/#annotate
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
gildir

Re: white text on gray background problem

Post by gildir »

I have already tried that, RGB and hex do not solve this problem. Text still seems to become transparent. Also, as I said, it works fine on a bright green or bright blue background.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: white text on gray background problem

Post by anthony »

gildir wrote:I have already tried that, RGB and hex do not solve this problem. Text still seems to become transparent. Also, as I said, it works fine on a bright green or bright blue background.
The HEX needs to be for CMYK! Whcih can be very tricky. I suggest you don't use CMYK for this type of thing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply