Probably another bug with HSL color conversion

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
captaingizmo
Posts: 1
Joined: 2013-03-20T05:00:56-07:00
Authentication code: 6789

Probably another bug with HSL color conversion

Post by captaingizmo »

Hello,

the problem is rather similar to those one from the year 2009: viewtopic.php?f=3&t=14741

Code: Select all

convert -size 100x100 xc:"hsl(0,122,122)" colorswatch_hsl2.png
Image

Code: Select all

   
    #include <Magick++.h>
    ...
    Image out_image( Geometry(pix_size, pix_size), Color(0,0,0,0));
    list<Drawable> square;
    colorf = ColorHSL(0,122,122);
    square.push_back(DrawableFillColor(colorf));
    square.push_back(DrawableRectangle(0, 0, pix_size, pix_size));
    out_image.draw(square);
    out_image.magick("gif");
    out_image.write("1.gif");
Image

Actually, c++ function ColorHSL results only in black, white and cyan colors for full range of variables.
I compile my binary with g++ 1.cpp `Magick++-config --cppflags --cxxflags --ldflags --libs`

libmagick++-dev 8:6.6.9.7-5ubuntu3.2
libgraphicsmagick++3 1.3.12-1.1build1
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Probably another bug with HSL color conversion

Post by magick »

Use normalized color values, e.g. ColorHSL(0,0.787,0.787).
Post Reply