Page 1 of 1

[Magick++] Image constructor bug

Posted: 2019-08-02T00:04:14-07:00
by Stitch07
I am using Magick++ version 7. I tried drawing a 500x500 colored image using this code:

Code: Select all

    Magick::Image canvas(Magick::Geometry(500, 500), Magick::ColorRGB(r, g, b));
    canvas.write("out.png");
It works for most colors, but fails for most orange ones - the samples I have are FF4500 and FFA500. Both are orange, but the output is yellow. The same yellow image is written for both hex codes. I have confirmed the RGB colors are correct.

The output image is attached below.

Image

Re: [Magick++] Image constructor bug

Posted: 2019-08-02T02:54:52-07:00
by snibgo
Exactly what version of IM? What does "magick -version" say?

I suggest you post a complete but minimal program that shows the problem. Then we can try to reproduce the problem.

Re: [Magick++] Image constructor bug

Posted: 2019-08-03T04:46:57-07:00
by magick
All color RGB arguments have a valid range of 0.0 - 1.0. #FF4500 is approximately Magick::ColorRGB(1.0, 0.27, 0.0). Or as a hex string: Color("#FF4500"). Both return the expected orange color.