JuicyPixels-3.3.5: Picture loading/serialization (in png, jpeg, bitmap, gif, tga, tiff and radiance)

Safe HaskellNone
LanguageHaskell2010

Codec.Picture.Bitmap

Contents

Description

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

Synopsis

Functions

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 -> ByteString Source #

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

encodeBitmapWithMetadata :: forall pixel. BmpEncodable pixel => Metadatas -> Image pixel -> ByteString Source #

Equivalent to encodeBitmap but also store the following metadatas:

decodeBitmap :: ByteString -> Either String DynamicImage Source #

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

decodeBitmapWithPaletteAndMetadata :: ByteString -> Either String (PalettedImage, Metadatas) Source #

Same as decodeBitmap but also extracts metadata and provide separated palette.

encodeDynamicBitmap :: DynamicImage -> Either String ByteString Source #

Encode a dynamic image in BMP if possible, supported images are:

encodeBitmapWithPaletteAndMetadata :: forall pixel. BmpEncodable pixel => Metadatas -> BmpPalette -> Image pixel -> ByteString Source #

Equivalent to encodeBitmapWithPalette but also store the following metadatas:

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 format in output

class BmpEncodable pixel Source #

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

Minimal complete definition

bitsPerPixel, bmpEncode, hasAlpha