Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Create image from pixel values with Imager

by Discipulus (Abbot)
on May 17, 2022 at 07:27 UTC ( #11143933=note: print w/replies, xml ) Need Help??


in reply to Create image from pixel values with Imager

Hello,

have you seen Re: How to create and save an image from RGB values?

Can you give us more details about slightly scrambled results?

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Create image from pixel values with Imager
by Anonymous Monk on May 17, 2022 at 07:40 UTC
    Yes I did see Re: How to create and save an image from RGB values (that's where I got the Imager code :^). Was going to mention it too but didn't, to keep things brief. By "scrambled" I mean the image is somehow partially correct, as if every other line is offset or something.

      Without more information, I can only guess, but it sounds like an off-by-one error. In your OP: "65536 values from 0-254". That suggests a 255x255 square which is 65025 values; a 256x256 square is 65536 values. Do you perhaps want to start with "65536 values from 0-255"?

      Update: s/off-by-error/off-by-one error/

      — Ken

        > Do you perhaps want to start with "65536 values from 0-255"?

        Exactly (but my data doesn't have any 255 value, 254 is highest). I don't think that's the problem because ImageMagick can convert the packed array to an image and it looks good. I don't know much about image formats or binary data. I learned that the array has to be packed like that by digging in this source code for Image::BMP.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-12-08 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?