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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Codec.Picture.Saving

Description

Helper functions to save dynamic images to other file format with automatic color space/sample format conversion done automatically.

Synopsis

- imageToJpg :: Int -> DynamicImage -> ByteString
- imageToPng :: DynamicImage -> ByteString
- imageToGif :: DynamicImage -> Either String ByteString
- imageToBitmap :: DynamicImage -> ByteString
- imageToTiff :: DynamicImage -> ByteString
- imageToRadiance :: DynamicImage -> ByteString
- imageToTga :: DynamicImage -> ByteString

# Documentation

imageToJpg :: Int -> DynamicImage -> ByteString Source #

This function will try to do anything to encode an image as JPEG, make all color conversion and such. Equivalent of `decodeImage` for jpeg encoding Save Y or YCbCr Jpeg only, all other colorspaces are converted. To save a RGB or CMYK JPEG file, use the `encodeDirectJpegAtQualityWithMetadata` function

imageToPng :: DynamicImage -> ByteString Source #

This function will try to do anything to encode an image as PNG, make all color conversion and such. Equivalent of `decodeImage` for PNG encoding

imageToGif :: DynamicImage -> Either String ByteString Source #

This function will try to do anything to encode an image as a gif, make all color conversion and quantization. Equivalent of `decodeImage` for gif encoding

imageToBitmap :: DynamicImage -> ByteString Source #

This function will try to do anything to encode an image as bitmap, make all color conversion and such. Equivalent of `decodeImage` for Bitmap encoding

imageToTiff :: DynamicImage -> ByteString Source #

This function will try to do anything to encode an image as a Tiff, make all color conversion and such. Equivalent of `decodeImage` for Tiff encoding

imageToRadiance :: DynamicImage -> ByteString Source #

This function will try to do anything to encode an image as RADIANCE, make all color conversion and such. Equivalent of `decodeImage` for radiance encoding

imageToTga :: DynamicImage -> ByteString Source #

This function will try to do anything to encode an image as a tga, make all color conversion and quantization. Equivalent of `decodeImage` for tga encoding