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


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

How about the PPM format? It's as simple as e.g. "P6 640 480 255\n" followed by the raw RGB binary data. It can be transformed by ImageMagick to any desired format.

Alternatively, see the write_to_scalar example in Image::PNG::Libpng.