|Portability||Repa interface to the DevIL image loading library.|
|Maintainer||Don Stewart <firstname.lastname@example.org>|
Read and write images in many formats, representing them in Haskell as a 3-dimensional repa array. Image parsing and decoding is done by the Developers Image Library, DevIL.
- Many formats are supported, including .png, .bmp, .jpg, .tif
- Image format parsing is determined by the filepath extension type.
Example: read a .png file into a 3D repa array, and write it out as a .jpg
main = runIL $ do x <- readImage "/tmp/y.png" writeImage "/tmp/x.jpg" x
Note that as DevIL is stateful, we ensure the library is initialized by running image manipulation functions in the IL monad, a wrapper over IO that ensures the library has been initialized. It is a type error to call image functions outside of the IL monad.
The IL monad
Running code in the IL monad. This is a simple wrapper over IO that guarantees the DevIL library has been initialized before you run functions on it.
The IL monad. Provides statically-guaranteed access to an initialized IL context.
Reads an image into an RGBA array. Indices are (row,column,color-channel).
main = do x <- runIL $ readImage "/tmp/x.png" .. operations on x ..
Note: The image input type is determined by the filename extension.