[Haskell] image writing library

Daan Leijen daan at cs.uu.nl
Thu Aug 5 08:27:12 EDT 2004

Ketil Malde wrote:

> I would like to write an (Array (Int,Int) Int) to a file in some kind
> of image format.  I implemented (quick and very dirty) XBM output, 
 > [snip]
> So, before I start,
> does anybody know any other libraries or programs that could be used?

Hi Ketil,

You could use wxHaskell to write (and read) files in many different
formats (like png, bmp, tif, jpg, ico, xbm, etc). If you build from
CVS, you will find the function "imageGetPixelArray" and 
"imageCreateFromPixelArray" in the "Graphics.UI.WXCore.Image" module.

If you use the latest packaged 0.8 release, you will have to do with
the lower level "pixelBufferSet/GetPixel" functions.

Note that if you do not call "start", there is no GUI stuff
involved and you can just use the image conversion functions of 
wxHaskell in a console application.

Not a minimal solution, but maybe good enough for your purposes.
All the best,

ps. In a recent mail to shelarcy in the wxHaskell users mail archive
you can find a program that shows how to use the lower level pixelBuffer 
functions in wxHaskell 0.8:

More information about the Haskell mailing list