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

Safe HaskellNone

Codec.Picture.Jpg

Description

Module used for JPEG file loading and writing.

Synopsis

Documentation

decodeJpeg :: ByteString -> Either String DynamicImageSource

Try to decompress a jpeg file and decompress. The colorspace is still YCbCr if you want to perform computation on the luma part. You can convert it to RGB using convertImage from the ColorSpaceConvertible typeclass.

This function can output the following pixel types :

  • PixelY8
  • PixelYCbCr8

encodeJpegAtQualitySource

Arguments

:: Word8

Quality factor

-> Image PixelYCbCr8

Image to encode

-> ByteString

Encoded JPEG

Function to call to encode an image to jpeg. The quality factor should be between 0 and 100 (100 being the best quality).

encodeJpeg :: Image PixelYCbCr8 -> ByteStringSource

Encode an image in jpeg at a reasonnable quality level. If you want better quality or reduced file size, you should use encodeJpegAtQuality

jpgMachineStep :: JpgFrame -> JpgScripter s ()Source

This pseudo interpreter interpret the Jpg frame for the huffman, quant table and restart interval parameters.

data JpgDecoderState Source

Constructors

JpgDecoderState !(Vector HuffmanPackedTree) !(Vector HuffmanPackedTree) !(Vector (MacroBlock Int16)) !Int (Maybe JpgFrameHeader) !Bool !Int !Int !Int