[Haskell-cafe] Reading images

Adrian Hey ahey at iee.org
Fri Jan 21 02:25:57 EST 2005


On Thursday 20 Jan 2005 7:35 pm, Dmitri Pissarenko wrote:
> Hello!
>
> I need to write a function in Haskell, which
>
> 1) reads a greyscale image (for instance, in JPEG, PNG or the like) and
>
> 2) transforms it into a n X m matrix A, where Aij contains an integer value
> (in the range 0 to 255). That integer value is zero for a completely black
> pixel, 255 for a completely white pixel and lies between zero and 255 for a
> grey pixel.
>
> In my program, I need ONLY to read an image and to transform it into such
> matrix.
>
> Which graphics library can you recommend, if no other image manipulation
> operations are required?

These might help..
 http://homepages.nildram.co.uk/~ahey/HLibs/Multimedia.SDL.Core/
 http://homepages.nildram.co.uk/~ahey/HLibs/Multimedia.SDL.Image/

What you'll get is an SDL surface (C data structure), so
you'll have to write some code to read it if you want a Haskell
array.

Regards
--
Adrian Hey
 


More information about the Haskell-Cafe mailing list