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

Safe HaskellNone
LanguageHaskell2010

Codec.Picture.Tiff

Description

Module implementing TIFF decoding.

Supported compression schemes:

  • Uncompressed
  • PackBits
  • LZW

Supported bit depth:

  • 2 bits
  • 4 bits
  • 8 bits
  • 16 bits

Synopsis

Documentation

decodeTiff :: ByteString -> Either String DynamicImage #

Decode a tiff encoded image while preserving the underlying pixel type (except for Y32 which is truncated to 16 bits).

This function can output the following images:

decodeTiffWithMetadata :: ByteString -> Either String (DynamicImage, Metadatas) #

Like decodeTiff but also provides some metdata present in the Tiff file.

The metadata extracted are the DpiX & DpiY information alongside the EXIF informations.

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

Decode TIFF and provide separated palette and metadata

class Pixel px => TiffSaveable px #

Class defining which pixel types can be serialized in a Tiff file.

Minimal complete definition

colorSpaceOfPixel

Instances

TiffSaveable PixelRGBA16 # 
TiffSaveable PixelRGBA8 # 

Methods

colorSpaceOfPixel :: PixelRGBA8 -> TiffColorspace

extraSampleCodeOfPixel :: PixelRGBA8 -> Maybe ExtraSample

subSamplingInfo :: PixelRGBA8 -> Vector Word32

TiffSaveable PixelCMYK16 # 
TiffSaveable PixelCMYK8 # 

Methods

colorSpaceOfPixel :: PixelCMYK8 -> TiffColorspace

extraSampleCodeOfPixel :: PixelCMYK8 -> Maybe ExtraSample

subSamplingInfo :: PixelCMYK8 -> Vector Word32

TiffSaveable PixelYCbCr8 # 
TiffSaveable PixelRGB16 # 

Methods

colorSpaceOfPixel :: PixelRGB16 -> TiffColorspace

extraSampleCodeOfPixel :: PixelRGB16 -> Maybe ExtraSample

subSamplingInfo :: PixelRGB16 -> Vector Word32

TiffSaveable PixelRGB8 # 

Methods

colorSpaceOfPixel :: PixelRGB8 -> TiffColorspace

extraSampleCodeOfPixel :: PixelRGB8 -> Maybe ExtraSample

subSamplingInfo :: PixelRGB8 -> Vector Word32

TiffSaveable PixelYA16 # 

Methods

colorSpaceOfPixel :: PixelYA16 -> TiffColorspace

extraSampleCodeOfPixel :: PixelYA16 -> Maybe ExtraSample

subSamplingInfo :: PixelYA16 -> Vector Word32

TiffSaveable PixelYA8 # 

Methods

colorSpaceOfPixel :: PixelYA8 -> TiffColorspace

extraSampleCodeOfPixel :: PixelYA8 -> Maybe ExtraSample

subSamplingInfo :: PixelYA8 -> Vector Word32

TiffSaveable Pixel16 # 

Methods

colorSpaceOfPixel :: Pixel16 -> TiffColorspace

extraSampleCodeOfPixel :: Pixel16 -> Maybe ExtraSample

subSamplingInfo :: Pixel16 -> Vector Word32

TiffSaveable Pixel8 # 

Methods

colorSpaceOfPixel :: Pixel8 -> TiffColorspace

extraSampleCodeOfPixel :: Pixel8 -> Maybe ExtraSample

subSamplingInfo :: Pixel8 -> Vector Word32

encodeTiff :: forall px. TiffSaveable px => Image px -> ByteString #

Transform an image into a Tiff encoded bytestring, ready to be written as a file.

writeTiff :: TiffSaveable pixel => FilePath -> Image pixel -> IO () #

Helper function to directly write an image as a tiff on disk.