Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Create image from pixel values with Imager

by Anonymous Monk
on May 17, 2022 at 13:12 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2024-04-23 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found