Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 lurking in the Monastery: (3)
As of 2024-04-25 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found