Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Create image from pixel values with Imager

by Anonymous Monk
on May 17, 2022 at 13:12 UTC ( #11143944=note: print w/replies, xml ) Need Help??


in reply to Create image from pixel values with Imager

See RAW. raw_datachannels default is 3. Either set it to 4, or better to 1 but then pack with C*.

Replies are listed 'Best First'.
Re^2: Create image from pixel values with Imager
by Anonymous Monk on May 17, 2022 at 13:48 UTC
    Thank you so much, this works perfectly:
    my $img = Imager->new( type => 'raw', xsize => 256, ysize => 256, data => pack('C*', @data), raw_interleave => 0, raw_datachannels => 1, raw_storechannels => 1 ); $img->write(file=>'data.png');

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11143944]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2022-11-30 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?