Possible bug with getting green and blue values

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
vasan.shrini
Posts: 1
Joined: 2019-09-12T08:35:12-07:00
Authentication code: 1152

Possible bug with getting green and blue values

Post by vasan.shrini » 2019-09-12T08:43:26-07:00

I am using ImageMagick++ 6.9.10. I am trying to read an image and get the R, G, B values. In whichever way I try, I always get the same values for the green and blue channels. Below is a sample code that illustrates the problem:

Magick::Image img_one('test.jpg');
Magick::ColorRGB img_one_px(img_one.pixelColor(10, 10)); // can be any pixel location in the image
cout << img_one_px.red() << " " << img_one_px.green() << " " << img_one_px.blue() << endl;

Irrespective of the pixel we choose in the second line above, the code always prints the same value for green() and blue(). I feel this is a bug that needs fixing. Please correct me if I am wrong.

Thanks a lot.
Shrini

Post Reply