Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-05-24 10:32 GMT
Find Nodes?
    Voting Booth?

    No recent polls found