JuicyPixels-1.1: Picture loading/serialization (in png, jpeg and bitmap)

Safe HaskellSafe-Infered




Modules used for Bitmap file (.bmp) file loading and writing



writeBitmap :: BmpEncodable pixel => FilePath -> Image pixel -> IO ()Source

Write an image in a file use the bitmap format.

encodeBitmap :: forall pixel. BmpEncodable pixel => Image pixel -> ByteStringSource

Encode an image into a bytestring in .bmp format ready to be written on disk.

decodeBitmap :: ByteString -> Either String DynamicImageSource

Try to decode a bitmap image. Right now this function can output the following pixel types :

  • PixelRGB8

encodeDynamicBitmap :: DynamicImage -> Either String ByteStringSource

Encode a dynamic image in bmp if possible, supported pixel type are :

  • RGB8
  • RGBA8
  • Y8

writeDynamicBitmap :: FilePath -> DynamicImage -> IO (Either String Bool)Source

Write a dynamic image in a .bmp image file if possible. The same restriction as encodeDynamicBitmap apply.

Accepted formt in output

class BmpEncodable pixel Source

All the instance of this class can be written as a bitmap file using this library.