[Magick++] Image constructor bug

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
Stitch07
Posts: 1
Joined: 2019-08-02T06:59:06+00:00
Authentication code: 1152

[Magick++] Image constructor bug

Post 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
snibgo
Posts: 12159
Joined: 2010-01-24T06:01:33+00:00
Authentication code: 1151
Location: England, UK

Re: [Magick++] Image constructor bug

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T18:32:55+00:00

Re: [Magick++] Image constructor bug

Post 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.
Post Reply