[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-01T23:59:06-07:00
Authentication code: 1152

[Magick++] Image constructor bug

Post by Stitch07 » 2019-08-02T00:04:14-07:00

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: 12429
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: [Magick++] Image constructor bug

Post by snibgo » 2019-08-02T02:54:52-07:00

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: 11098
Joined: 2003-05-31T11:32:55-07:00

Re: [Magick++] Image constructor bug

Post by magick » 2019-08-03T04:46:57-07:00

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