Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:
I'm using Image::Magick to get the individual colour of each pixel of an image.
What I'm getting back when I do this:
GetPixel( 'x' => $x_position, 'y' => $y_position );
Is something like this:
[ '0.980392156862745', '0.996078431372549', '0.996078431372549' ]
And I'm having to turn that into a hexadecimal code myself with a subroutine where each value is translated with
sprintf( "%02x", $_ * 255 );
So, is there any way I can get back hex values from GetPixel?
I'm a little confused about where full documentation for the perl ImageMagick module could be found. The stuff on CPAN is quite brief (doesn't even mention GetPixel), and the stuff on the ImageMagick site doesn't really help.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Getting pixel colours with Image::Magick
by vr (Curate) on Aug 11, 2019 at 10:45 UTC | |
Re: Getting pixel colours with Image::Magick
by LanX (Saint) on Aug 11, 2019 at 09:05 UTC | |
by Corion (Patriarch) on Aug 11, 2019 at 09:11 UTC | |
by Your Mother (Archbishop) on Aug 11, 2019 at 15:36 UTC | |
by LanX (Saint) on Aug 11, 2019 at 09:20 UTC |
Back to
Seekers of Perl Wisdom