Page 1 of 1

Linear gradient does not work

Posted: 2012-01-31T07:32:00-07:00
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

Re: Linear gradient does not work

Posted: 2012-01-31T10:50:28-07:00
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

Re: Linear gradient does not work

Posted: 2012-01-31T16:36:52-07:00
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!

Re: Linear gradient does not work

Posted: 2012-01-31T17:39:26-07:00
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.