pngload-0.1: Pure Haskell loader for PNG images

Portabilitynon-portable (GHC only)
Stabilityexperimental
Maintainermarko.lauronen@pp1.inet.fi

Codec.Image.PNG

Contents

Description

A simple, pure Haskell PNG loader. Currently supports 24bit RGB(A) images with no interlacing. Also lacks support for color indexed (paletted) images.

The image is stored in a StorableArray for compatibility with OpenGL (the array supports getting Ptr Word8 to the image data using withStorableArray function).

Synopsis

Types

data PNGImage Source

Instances

Functions

loadPNGFile :: FilePath -> IO (Either String PNGImage)Source

Load a PNG file, Left value contains a description of a problem as a String, if any

dimensions :: PNGImage -> (Width, Height)Source

Get dimensions of the image (in pixels)

imageData :: PNGImage -> StorableArray (Int, Int) Word8Source

Get image data as C-compatible StorableArray

hasAlphaChannel :: PNGImage -> BoolSource

Check if the image has alpha channel