shortland has asked for the wisdom of the Perl Monks concerning the following question:
Here's the code I'm using; the output is a scalar quantity.
Is there a way with Imager module to convert the scalar quantity to rgba/hex colors?
#!/usr/bin/perl use Imager; # read file $img = Imager->new(); $img->read(file=>'pixelateMe.png', type=>'png') or die $img->errstr(); # create array - values for pixel values my @colors = $img->getpixel(x => [ 0 ], y => [ 0 .. 1 ]); print @colors[0]; # output is "scalar": Imager::Color=SCALAR(0xb97800)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using module Imager, how to convert scalar-color value to hex/rgba color value?
by BrowserUk (Patriarch) on Dec 02, 2015 at 17:20 UTC | |
|
Re: Using module Imager, how to convert scalar-color value to hex/rgba color value?
by tonyc (Hermit) on Jan 06, 2016 at 03:27 UTC |