Module used for loading & writing 'Portable Network Graphics' (PNG) files. The API has two layers, the high level, which load the image without looking deeply about it and the low level, allowing access to data chunks contained in the PNG image.
For general use, please use
The loader has been validated against the pngsuite (http:www.libpng.orgpubpng/pngsuite.html)
- class PngSavable a where
- decodePng :: ByteString -> Either String DynamicImage
- writePng :: PngSavable pixel => FilePath -> Image pixel -> IO ()
- encodeDynamicPng :: DynamicImage -> Either String ByteString
- writeDynamicPng :: FilePath -> DynamicImage -> IO (Either String Bool)
High level functions
Encode an image into a png if possible.
Transform an image into a png encoded bytestring, ready to be writte as a file.
Transform a raw png image to an image, without modifying the underlying pixel type. If the image is greyscale and < 8 bits, a transformation to RGBA8 is performed. This should change in the future. The resulting image let you manage the pixel types.
This function can output the following pixel types :
Helper function to directly write an image as a png on disk.
Encode a dynamic image in bmp if possible, supported pixel type are :