Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How to create and save an image from RGB values

by harangzsolt33 (Chaplain)
on Dec 29, 2021 at 18:57 UTC ( [id://11140012]=note: print w/replies, xml ) Need Help??


in reply to How to create and save an image from RGB values

So, why don't you just save your data as a 24-bit BMP image? Those are pretty simple format. It contains a pretty simple header, which is just a few bytes, followed by : Blue value (1 byte); Green value (1 byte); Red value (1 byte); at the end of a horizontal line, there are two zero bytes. Next line. Same thing. At the end of the file: two zero bytes. Pretty simple. You should write your own SaveBMP() function. I am thinking about writing one, because I may need it as well....

sub SaveBMP       # Usage: SaveBMP($filename, $width, $height, $image_data)
{
     ...
}

  • Comment on Re: How to create and save an image from RGB values

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-18 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found