http://qs1969.pair.com?node_id=11140012


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