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

Safe HaskellNone
LanguageHaskell2010

Codec.Picture.Png.Internal.Export

Description

Module implementing a basic png export, no filtering is applyed, but export at least valid images.

Synopsis

Documentation

class PngSavable a where #

Encode an image into a png if possible.

Minimal complete definition

encodePngWithMetadata

Methods

encodePng :: Image a -> ByteString #

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

encodePngWithMetadata :: Metadatas -> Image a -> ByteString #

Encode a png using some metadatas. The following metadata keys will be stored in a tEXt field :

the followings metadata will bes tored in the gAMA chunk.

The followings metadata will be stored in a pHYs chunk

Instances
PngSavable PixelRGBA16 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

PngSavable PixelRGBA8 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

PngSavable PixelRGB16 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

PngSavable PixelRGB8 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

PngSavable PixelYA16 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

PngSavable PixelYA8 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

PngSavable Pixel16 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

PngSavable Pixel8 # 
Instance details

Defined in Codec.Picture.Png.Internal.Export

class PngPaletteSaveable a where #

Encode a paletted image into a png if possible.

Minimal complete definition

encodePalettedPngWithMetadata

Methods

encodePalettedPng :: Image a -> Image Pixel8 -> Either String ByteString #

Encode a paletted image as a color indexed 8-bit PNG. the palette must have between 1 and 256 values in it. Accepts PixelRGB8 and PixelRGBA8 as palette pixel type

encodePalettedPngWithMetadata :: Metadatas -> Image a -> Image Pixel8 -> Either String ByteString #

Equivalent to encodePalettedPng but allow writing of metadatas. See encodePngWithMetadata for the details of encoded metadatas Accepts PixelRGB8 and PixelRGBA8 as palette pixel type

writePng :: PngSavable pixel => FilePath -> Image pixel -> IO () #

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

writeDynamicPng :: FilePath -> DynamicImage -> IO (Either String Bool) #

Write a dynamic image in a .png image file if possible. The same restriction as encodeDynamicPng apply.