hsl not working as expected

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
daviddoria

hsl not working as expected

Post by daviddoria »

I am trying to make a block a certain hsl color. This works with rgb (creates a red image 200x100):

Code: Select all

convert -size 200x100 xc:rgb\(255,0,0\) rgb.png
I thought this would do exactly the same thing:

Code: Select all

convert -size 200x100 xc:hsl\(0,100%,50%\) hsl.png
but it produces a black image. Why is that?

Thanks,

Dave
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: hsl not working as expected

Post by magick »

We get a red image as expected. We're using ImageMagick 6.5.1-7, the current release.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: hsl not working as expected

Post by fmw42 »

put any colors specified as rgb or hsl in quotes, e.g. xc:"hsl(0,100%,50%)"

see http://www.imagemagick.org/script/color.php

What IM version are you using? Perhaps it is too old.
daviddoria

Re: hsl not working as expected

Post by daviddoria »

Same black result with the quotes:

Code: Select all

convert -size 200x100 xc:"hsl(100,100%, 50%)" square.png
I'm using
ImageMagick.i386 6.4.0.10-2.fc10

I'll try upgrading, but it seems odd that it would not give an error and just not work?

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

Re: hsl not working as expected

Post by fmw42 »

I get using IM 6.5.1-7 Q16 Mac OSX Tiger:

convert -size 200x100 xc:"hsl(100,100%, 50%)" green_box.png

Image
daviddoria

Re: hsl not working as expected

Post by daviddoria »

Here's my result of the same green_box command:
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: hsl not working as expected

Post by fmw42 »

could have been a bug in your old version of IM. try upgrading.
Post Reply