Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Create image from pixel values with Imager

by tonyc (Pilgrim)
on Jun 07, 2022 at 12:05 UTC ( #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? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-11-30 17:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?