Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Create image from pixel values with Imager

by tonyc (Friar)
on Jun 07, 2022 at 12:05 UTC ( [id://11144480]=note: print w/replies, xml ) Need Help??


in reply to Create image from pixel values with Imager

Unfortunately raw_datachannels doesn't follow raw_storechannels, so if you supply one, you probably need to supply the other, this also lets you switch to pack "C*" to pack the data as bytes. I don't have your data, so I can't check this does exactly what you want.

my $img = Imager->new( type => 'raw', xsize => 256, ysize => 256, data => pack('C*', @data), raw_interleave => 0, raw_storechannels => 1, raw_datachannels => 1, model => 'gray' ); $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://11144480]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2025-06-16 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.