Linear gradient does not work

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
aehmann
Posts: 1
Joined: 2012-01-31T07:01:57-07:00
Authentication code: 8675308

Linear gradient does not work

Post by aehmann »

Hello,

we are using imagemagick for creating background images on the fly. We invoke the command convert -size 100x28 gradient:#FFFFFF-#DDDDDD "MyFile.gif". The result is a image what has no gradient at all. It seems to me that using other colors than white will work. But if white is part of the gradient the image is not created correct.

What we expect (Version: ImageMagick 6.3.7)
Image

What we get (Version: ImageMagick 6.5.4-7)
Image


This happens only on some Linux System mainly on Redhat 5/6 and CentOS and with different IM versions greater than 6.4. Are we dealing with a bug?
Is there a solution? We have no idea at the moment.

Thanks in advance
Alex
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Linear gradient does not work

Post by fmw42 »

try with quotes

gradient:"#FFFFFF-#DDDDDD"

all rgb(...) and hex colors must be specified with quotes. see http://www.imagemagick.org/script/color.php
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Linear gradient does not work

Post by anthony »

The quotes is to protect the '#' colors from the shell parser. It can be very important.

Though it comes out correct for me with my BASH shell, with or without the quotes. (v6.7.4-10)

Code: Select all

convert -size 100x28 "gradient:#FFFFFF-#DDDDDD" txt:- | less
shows the colors are correct!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Linear gradient does not work

Post by fmw42 »

even your version 6.5.4-7 is about 200 versions old. perhaps there was a bug at that point. perhaps an upgrade to a newer version might help if the quotes do not.
Post Reply