Page 1 of 1

Get RGB value of a pixel

Posted: 2008-08-10T11:23:48-07:00
by Zeokat

Code: Select all

my @pixel = $image_magick->GetPixel(x=>"$i",y=>"$j");
print @pixel,"\n";
0.898039215686275 0.898039215686275 0.898039215686275

I obtain these values... how can i get the rgb values?

Re: Get RGB value of a pixel

Posted: 2008-08-10T11:40:54-07:00
by magick
The pixel values are normalized. The first value is red, the second green, and the third of course is blue. If you want traditional pixel values from [ 0 .. 255 ], simply multiply by 255.0.