massiv-io-0.1.4.0: Import/export of Image files into massiv Arrays

Copyright(c) Alexey Kuleshevich 2018
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Massiv.Array.IO

Contents

Description

 
Synopsis

Reading

readArray #

Arguments

:: Readable f arr 
=> f

File format that should be used while decoding the file

-> ReadOptions f

Any file format related decoding options. Use def for default.

-> FilePath

Path to the file

-> IO arr 

Read an array from one of the supported file formats.

readImage #

Arguments

:: (Source S Ix2 (Pixel cs e), ColorSpace cs e) 
=> FilePath

File path for an image

-> IO (Image S cs e) 

Try to guess an image format from file's extension, then attempt to decode it as such. In order to supply the format manually and thus avoid this guessing technique, use readArray instead. Color space and precision of the result array must match exactly that of the actual image, in order to apply auto conversion use readImageAuto instead.

Might throw ConvertError, DecodeError and other standard errors related to file IO.

Result image will be read as specified by the type signature:

>>> frog <- readImage "files/frog.jpg" :: IO (Image S YCbCr Word8)
>>> displayImage frog

In case when the result image type does not match the color space or precision of the actual image file, ConvertError will be thrown.

>>> frog <- readImage "files/frog.jpg" :: IO (Image S CMYK Word8)
>>> displayImage frog
*** Exception: ConvertError "Cannot decode JPG image <Image S YCbCr Word8> as <Image S CMYK Word8>"

Whenever image is not in the color space or precision that we need, either use readImageAuto or manually convert to the desired one by using the appropriate conversion functions:

>>> frogCMYK <- readImageAuto "files/frog.jpg" :: IO (Image S CMYK Double)
>>> displayImage frogCMYK

readImageAuto #

Arguments

:: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) 
=> FilePath

File path for an image

-> IO (Image r cs e) 

Same as readImage, but will perform any possible color space and precision conversions in order to match the result image type. Very useful whenever image format isn't known at compile time.

Writing

writeArray #

Arguments

:: Writable f arr 
=> f

Format to use while encoding the array

-> WriteOptions f

Any file format related encoding options. Use def for default.

-> FilePath 
-> arr 
-> IO () 

writeImage :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => FilePath -> Image r cs e -> IO () #

This function will guess an output file format from the file extension and will write to file any image with the colorspace that is supported by that format. Precision of the image might be adjusted using Elevator if precision of the source array is not supported by the image file format. For instance an (Image r RGBA Double) being saved as PNG file would be written as (Image r RGBA Word16), thus using highest supported precision Word16 for that format. If automatic colors space is also desired, writeImageAuto can be used instead.

Can throw ConvertError, EncodeError and other usual IO errors.

writeImageAuto :: (Source r Ix2 (Pixel cs e), ColorSpace cs e, ToYA cs e, ToRGBA cs e, ToYCbCr cs e, ToCMYK cs e) => FilePath -> Image r cs e -> IO () #

Write an image to file while performing all necessary precisiona and color space conversions.

Displaying

data ExternalViewer #

External viewing application to use for displaying images.

Constructors

ExternalViewer FilePath [String] Int

Any custom viewer, which can be specified:

  • FilePath - to the actual viewer executable.
  • [String] - command line arguments that will be passed to the executable.
  • Int - position index in the above list where FilePath to an image should be injected

displayImage :: Writable (Auto TIF) (Image r cs e) => Image r cs e -> IO () #

Makes a call to an external viewer that is set as a default image viewer by the OS. This is a non-blocking function call, so it might take some time before an image will appear.

displayImageUsing #

Arguments

:: Writable (Auto TIF) (Image r cs e) 
=> ExternalViewer

Image viewer program

-> Bool

Should a call block the cuurrent thread untul viewer is closed.

-> Image r cs e 
-> IO () 

An image is written as a .tiff file into an operating system's temporary directory and passed as an argument to the external viewer program.

displayImageFile :: ExternalViewer -> FilePath -> IO () #

Displays an image file by calling an external image viewer.

Common viewers

defaultViewer :: ExternalViewer #

Default viewer is inferred from the operating system.

eogViewer :: ExternalViewer #

eog /tmp/hip/img.tiff

Eye of GNOME

gpicviewViewer :: ExternalViewer #

gpicview /tmp/hip/img.tiff

GPicView

fehViewer :: ExternalViewer #

feh --fullscreen --auto-zoom /tmp/hip/img.tiff

FEH

gimpViewer :: ExternalViewer #

gimp /tmp/hip/img.tiff

GIMP

Supported Image Formats

class Writable f arr where #

Arrays that can be written into a file.

Minimal complete definition

encode

Methods

encode :: f -> WriteOptions f -> arr -> ByteString #

Encode an array into a ByteString.

Instances
(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TIF (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TIF -> WriteOptions TIF -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TGA (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TGA -> WriteOptions TGA -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable JPG (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: JPG -> WriteOptions JPG -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable HDR (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: HDR -> WriteOptions HDR -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable GIF (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: GIF -> WriteOptions GIF -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable PNG (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: PNG -> WriteOptions PNG -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable BMP (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: BMP -> WriteOptions BMP -> Image r cs e -> ByteString #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TIF -> WriteOptions (Auto TIF) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TGA) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TGA -> WriteOptions (Auto TGA) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToYCbCr cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto JPG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto JPG -> WriteOptions (Auto JPG) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto HDR) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto HDR -> WriteOptions (Auto HDR) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToY cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto GIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto GIF -> WriteOptions (Auto GIF) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToYA cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto PNG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto PNG -> WriteOptions (Auto PNG) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto BMP) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto BMP -> WriteOptions (Auto BMP) -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable (Sequence GIF) (Array B Ix1 (GifDelay, Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Writable (Encode (Image r cs e)) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

encode :: Encode (Image r cs e) -> WriteOptions (Encode (Image r cs e)) -> Image r cs e -> ByteString #

class Readable f arr where #

File formats that can be read into an Array.

Minimal complete definition

decode

Methods

decode :: f -> ReadOptions f -> ByteString -> arr #

Decode a ByteString into an Array.

Instances
ColorSpace cs e => Readable TIF (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TIF -> ReadOptions TIF -> ByteString -> Image S cs e #

ColorSpace cs e => Readable TGA (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TGA -> ReadOptions TGA -> ByteString -> Image S cs e #

ColorSpace cs e => Readable JPG (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: JPG -> ReadOptions JPG -> ByteString -> Image S cs e #

ColorSpace cs e => Readable HDR (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: HDR -> ReadOptions HDR -> ByteString -> Image S cs e #

ColorSpace cs e => Readable GIF (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: GIF -> ReadOptions GIF -> ByteString -> Image S cs e #

ColorSpace cs e => Readable PNG (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: PNG -> ReadOptions PNG -> ByteString -> Image S cs e #

ColorSpace cs e => Readable BMP (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: BMP -> ReadOptions BMP -> ByteString -> Image S cs e #

ColorSpace cs e => Readable PPM (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PPM -> ReadOptions PPM -> ByteString -> Image S cs e #

ColorSpace cs e => Readable PGM (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PGM -> ReadOptions PGM -> ByteString -> Image S cs e #

ColorSpace cs e => Readable PBM (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PBM -> ReadOptions PBM -> ByteString -> Image S cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TIF -> ReadOptions (Auto TIF) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TGA) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TGA -> ReadOptions (Auto TGA) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto JPG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto JPG -> ReadOptions (Auto JPG) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto HDR) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto HDR -> ReadOptions (Auto HDR) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto GIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto GIF -> ReadOptions (Auto GIF) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PNG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto PNG -> ReadOptions (Auto PNG) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto BMP) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto BMP -> ReadOptions (Auto BMP) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PPM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PPM -> ReadOptions (Auto PPM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PGM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PGM -> ReadOptions (Auto PGM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PBM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PBM -> ReadOptions (Auto PBM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (GifDelay, Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence PPM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PGM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PBM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Readable (Decode (Image r cs e)) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

decode :: Decode (Image r cs e) -> ReadOptions (Decode (Image r cs e)) -> ByteString -> Image r cs e #

class (Default (ReadOptions f), Default (WriteOptions f), Show f) => FileFormat f where #

File format. Helps in guessing file format from a file extension, as well as supplying format specific options during saving the file.

Minimal complete definition

ext

Associated Types

type ReadOptions f #

Options that can be used during reading a file in this format.

type WriteOptions f #

Options that can be used during writing a file in this format.

Methods

ext :: f -> String #

Default file extension for this file format.

exts :: f -> [String] #

Other known file extensions for this file format, eg. ".jpeg", ".jpg".

isFormat :: String -> f -> Bool #

Checks if a file extension corresponds to the format, eg. isFormat ".png" PNG == True

Instances
FileFormat TIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TIF :: * #

type WriteOptions TIF :: * #

Methods

ext :: TIF -> String #

exts :: TIF -> [String] #

isFormat :: String -> TIF -> Bool #

FileFormat TGA # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TGA :: * #

type WriteOptions TGA :: * #

Methods

ext :: TGA -> String #

exts :: TGA -> [String] #

isFormat :: String -> TGA -> Bool #

FileFormat JPG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions JPG :: * #

type WriteOptions JPG :: * #

Methods

ext :: JPG -> String #

exts :: JPG -> [String] #

isFormat :: String -> JPG -> Bool #

FileFormat HDR # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions HDR :: * #

type WriteOptions HDR :: * #

Methods

ext :: HDR -> String #

exts :: HDR -> [String] #

isFormat :: String -> HDR -> Bool #

FileFormat GIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions GIF :: * #

type WriteOptions GIF :: * #

Methods

ext :: GIF -> String #

exts :: GIF -> [String] #

isFormat :: String -> GIF -> Bool #

FileFormat PNG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions PNG :: * #

type WriteOptions PNG :: * #

Methods

ext :: PNG -> String #

exts :: PNG -> [String] #

isFormat :: String -> PNG -> Bool #

FileFormat BMP # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions BMP :: * #

type WriteOptions BMP :: * #

Methods

ext :: BMP -> String #

exts :: BMP -> [String] #

isFormat :: String -> BMP -> Bool #

FileFormat PPM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PPM :: * #

type WriteOptions PPM :: * #

Methods

ext :: PPM -> String #

exts :: PPM -> [String] #

isFormat :: String -> PPM -> Bool #

FileFormat PGM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PGM :: * #

type WriteOptions PGM :: * #

Methods

ext :: PGM -> String #

exts :: PGM -> [String] #

isFormat :: String -> PGM -> Bool #

FileFormat PBM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PBM :: * #

type WriteOptions PBM :: * #

Methods

ext :: PBM -> String #

exts :: PBM -> [String] #

isFormat :: String -> PBM -> Bool #

FileFormat f => FileFormat (Auto f) # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Associated Types

type ReadOptions (Auto f) :: * #

type WriteOptions (Auto f) :: * #

Methods

ext :: Auto f -> String #

exts :: Auto f -> [String] #

isFormat :: String -> Auto f -> Bool #

FileFormat (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: * #

type WriteOptions (Sequence (Auto GIF)) :: * #

FileFormat (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: * #

type WriteOptions (Sequence (Auto PPM)) :: * #

FileFormat (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: * #

type WriteOptions (Sequence (Auto PGM)) :: * #

FileFormat (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: * #

type WriteOptions (Sequence (Auto PBM)) :: * #

FileFormat (Sequence GIF) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence GIF) :: * #

type WriteOptions (Sequence GIF) :: * #

FileFormat (Sequence PPM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PPM) :: * #

type WriteOptions (Sequence PPM) :: * #

FileFormat (Sequence PGM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PGM) :: * #

type WriteOptions (Sequence PGM) :: * #

FileFormat (Sequence PBM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PBM) :: * #

type WriteOptions (Sequence PBM) :: * #

FileFormat (Decode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Decode (Image r cs e)) :: * #

type WriteOptions (Decode (Image r cs e)) :: * #

Methods

ext :: Decode (Image r cs e) -> String #

exts :: Decode (Image r cs e) -> [String] #

isFormat :: String -> Decode (Image r cs e) -> Bool #

FileFormat (Encode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Encode (Image r cs e)) :: * #

type WriteOptions (Encode (Image r cs e)) :: * #

Methods

ext :: Encode (Image r cs e) -> String #

exts :: Encode (Image r cs e) -> [String] #

isFormat :: String -> Encode (Image r cs e) -> Bool #

newtype Auto f #

Constructors

Auto f 
Instances
Show f => Show (Auto f) # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Methods

showsPrec :: Int -> Auto f -> ShowS #

show :: Auto f -> String #

showList :: [Auto f] -> ShowS #

FileFormat f => FileFormat (Auto f) # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Associated Types

type ReadOptions (Auto f) :: * #

type WriteOptions (Auto f) :: * #

Methods

ext :: Auto f -> String #

exts :: Auto f -> [String] #

isFormat :: String -> Auto f -> Bool #

FileFormat (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: * #

type WriteOptions (Sequence (Auto GIF)) :: * #

FileFormat (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: * #

type WriteOptions (Sequence (Auto PPM)) :: * #

FileFormat (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: * #

type WriteOptions (Sequence (Auto PGM)) :: * #

FileFormat (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: * #

type WriteOptions (Sequence (Auto PBM)) :: * #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TIF -> WriteOptions (Auto TIF) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TGA) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TGA -> WriteOptions (Auto TGA) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToYCbCr cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto JPG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto JPG -> WriteOptions (Auto JPG) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto HDR) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto HDR -> WriteOptions (Auto HDR) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToY cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto GIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto GIF -> WriteOptions (Auto GIF) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToYA cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto PNG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto PNG -> WriteOptions (Auto PNG) -> Image r cs e -> ByteString #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto BMP) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto BMP -> WriteOptions (Auto BMP) -> Image r cs e -> ByteString #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TIF -> ReadOptions (Auto TIF) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TGA) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TGA -> ReadOptions (Auto TGA) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto JPG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto JPG -> ReadOptions (Auto JPG) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto HDR) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto HDR -> ReadOptions (Auto HDR) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto GIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto GIF -> ReadOptions (Auto GIF) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PNG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto PNG -> ReadOptions (Auto PNG) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto BMP) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto BMP -> ReadOptions (Auto BMP) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PPM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PPM -> ReadOptions (Auto PPM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PGM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PGM -> ReadOptions (Auto PGM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PBM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PBM -> ReadOptions (Auto PBM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Auto f) # 
Instance details

Defined in Data.Massiv.Array.IO.Base

type ReadOptions (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Auto f) # 
Instance details

Defined in Data.Massiv.Array.IO.Base

type WriteOptions (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

newtype Sequence f #

Special wrapper for formats that support encoding/decoding sequence of array.

Constructors

Sequence f 
Instances
Show f => Show (Sequence f) # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Methods

showsPrec :: Int -> Sequence f -> ShowS #

show :: Sequence f -> String #

showList :: [Sequence f] -> ShowS #

FileFormat (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: * #

type WriteOptions (Sequence (Auto GIF)) :: * #

FileFormat (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: * #

type WriteOptions (Sequence (Auto PPM)) :: * #

FileFormat (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: * #

type WriteOptions (Sequence (Auto PGM)) :: * #

FileFormat (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: * #

type WriteOptions (Sequence (Auto PBM)) :: * #

FileFormat (Sequence GIF) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence GIF) :: * #

type WriteOptions (Sequence GIF) :: * #

FileFormat (Sequence PPM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PPM) :: * #

type WriteOptions (Sequence PPM) :: * #

FileFormat (Sequence PGM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PGM) :: * #

type WriteOptions (Sequence PGM) :: * #

FileFormat (Sequence PBM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PBM) :: * #

type WriteOptions (Sequence PBM) :: * #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable (Sequence GIF) (Array B Ix1 (GifDelay, Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (GifDelay, Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence PPM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PGM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PBM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence GIF) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence PPM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PGM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PBM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence GIF) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence PPM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PGM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PBM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

newtype EncodeError #

This exception can be thrown while writing/encoding into a file and indicates an error in an array that is being encoded.

Constructors

EncodeError String 

newtype DecodeError #

This exception can be thrown while reading/decoding a file and indicates an error in the file itself.

Constructors

DecodeError String 

newtype ConvertError #

Conversion error, which is thrown when there is a mismatch between the expected array type and the one supported by the file format. It is also thrown upon a failure of automatic conversion between those types, in case such conversion is utilized.

Constructors

ConvertError String 

type Image r cs e = Array r Ix2 (Pixel cs e) #

defaultReadOptions :: FileFormat f => f -> ReadOptions f #

Generate default read options for a file format

defaultWriteOptions :: FileFormat f => f -> WriteOptions f #

Generate default write options for a file format

data Encode out #

Instances
Show (Encode out) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

showsPrec :: Int -> Encode out -> ShowS #

show :: Encode out -> String #

showList :: [Encode out] -> ShowS #

FileFormat (Encode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Encode (Image r cs e)) :: * #

type WriteOptions (Encode (Image r cs e)) :: * #

Methods

ext :: Encode (Image r cs e) -> String #

exts :: Encode (Image r cs e) -> [String] #

isFormat :: String -> Encode (Image r cs e) -> Bool #

Writable (Encode (Image r cs e)) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

encode :: Encode (Image r cs e) -> WriteOptions (Encode (Image r cs e)) -> Image r cs e -> ByteString #

type ReadOptions (Encode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type ReadOptions (Encode (Image r cs e)) = ()
type WriteOptions (Encode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type WriteOptions (Encode (Image r cs e)) = ()

encodeImage #

Arguments

:: (Source r Ix2 (Pixel cs e), ColorSpace cs e) 
=> [Encode (Image r cs e)]

List of image formats to choose from (useful lists are imageWriteFormats and imageWriteAutoFormats

-> FilePath

File name with extension, so the format can be inferred

-> Image r cs e

Image to encode

-> ByteString 

Encode an image into a lazy ByteString, while selecting the appropriate format from the file extension.

imageWriteFormats :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => [Encode (Image r cs e)] #

List of image formats that can be encoded without any color space conversion.

imageWriteAutoFormats :: (Source r Ix2 (Pixel cs e), ColorSpace cs e, ToYA cs e, ToRGBA cs e, ToYCbCr cs e, ToCMYK cs e) => [Encode (Image r cs e)] #

List of image formats that can be encoded with any necessary color space conversions.

data Decode out #

Instances
Show (Decode out) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

showsPrec :: Int -> Decode out -> ShowS #

show :: Decode out -> String #

showList :: [Decode out] -> ShowS #

FileFormat (Decode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Decode (Image r cs e)) :: * #

type WriteOptions (Decode (Image r cs e)) :: * #

Methods

ext :: Decode (Image r cs e) -> String #

exts :: Decode (Image r cs e) -> [String] #

isFormat :: String -> Decode (Image r cs e) -> Bool #

Readable (Decode (Image r cs e)) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

decode :: Decode (Image r cs e) -> ReadOptions (Decode (Image r cs e)) -> ByteString -> Image r cs e #

type ReadOptions (Decode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type ReadOptions (Decode (Image r cs e)) = ()
type WriteOptions (Decode (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type WriteOptions (Decode (Image r cs e)) = ()

decodeImage #

Arguments

:: (Source r Ix2 (Pixel cs e), ColorSpace cs e) 
=> [Decode (Image r cs e)]

List of available formats to choose from

-> FilePath

File name with extension, so format can be inferred

-> ByteString

Encoded image

-> Image r cs e 

Decode an image from the strict ByteString while inferring format the image is encoded in from the file extension

imageReadFormats :: (Source S Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image S cs e)] #

List of image formats decodable with no colorspace conversion

imageReadAutoFormats :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image r cs e)] #

List of image formats decodable with no colorspace conversion

JuicyPixels formats

BMP

data BMP #

Bitmap image with .bmp extension.

Constructors

BMP 
Instances
Show BMP # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> BMP -> ShowS #

show :: BMP -> String #

showList :: [BMP] -> ShowS #

FileFormat BMP # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions BMP :: * #

type WriteOptions BMP :: * #

Methods

ext :: BMP -> String #

exts :: BMP -> [String] #

isFormat :: String -> BMP -> Bool #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable BMP (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: BMP -> WriteOptions BMP -> Image r cs e -> ByteString #

ColorSpace cs e => Readable BMP (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: BMP -> ReadOptions BMP -> ByteString -> Image S cs e #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto BMP) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto BMP -> WriteOptions (Auto BMP) -> Image r cs e -> ByteString #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto BMP) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto BMP -> ReadOptions (Auto BMP) -> ByteString -> Image r cs e #

type ReadOptions BMP # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions BMP = ()
type WriteOptions BMP # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions BMP = ()

GIF

data GIF #

Graphics Interchange Format image with .gif extension.

Constructors

GIF 
Instances
Show GIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> GIF -> ShowS #

show :: GIF -> String #

showList :: [GIF] -> ShowS #

FileFormat GIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions GIF :: * #

type WriteOptions GIF :: * #

Methods

ext :: GIF -> String #

exts :: GIF -> [String] #

isFormat :: String -> GIF -> Bool #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable GIF (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: GIF -> WriteOptions GIF -> Image r cs e -> ByteString #

ColorSpace cs e => Readable GIF (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: GIF -> ReadOptions GIF -> ByteString -> Image S cs e #

FileFormat (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: * #

type WriteOptions (Sequence (Auto GIF)) :: * #

FileFormat (Sequence GIF) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence GIF) :: * #

type WriteOptions (Sequence GIF) :: * #

(ColorSpace cs e, ToY cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto GIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto GIF -> WriteOptions (Auto GIF) -> Image r cs e -> ByteString #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable (Sequence GIF) (Array B Ix1 (GifDelay, Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto GIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto GIF -> ReadOptions (Auto GIF) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (GifDelay, Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions GIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions GIF = ()
type WriteOptions GIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence GIF) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence (Auto GIF)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence GIF) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

data PaletteOptions #

To specify how the palette will be created.

Constructors

PaletteOptions 

Fields

data PaletteCreationMethod #

Define which palette creation method is used.

Constructors

MedianMeanCut

MedianMeanCut method, provide the best results (visualy) at the cost of increased calculations.

Uniform

Very fast algorithm (one pass), doesn't provide good looking results.

Animated

type GifDelay = Int #

Delay to wait before showing the next Gif image. The delay is expressed in 100th of seconds.

data GifLooping #

Help to control the behaviour of GIF animation looping.

Constructors

LoopingNever

The animation will stop once the end is reached

LoopingForever

The animation will restart once the end is reached

LoopingRepeat Word16

The animation will repeat n times before stoping

HDR

data HDR #

High-dynamic-range image with .hdr or .pic extension.

Constructors

HDR 
Instances
Show HDR # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> HDR -> ShowS #

show :: HDR -> String #

showList :: [HDR] -> ShowS #

FileFormat HDR # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions HDR :: * #

type WriteOptions HDR :: * #

Methods

ext :: HDR -> String #

exts :: HDR -> [String] #

isFormat :: String -> HDR -> Bool #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable HDR (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: HDR -> WriteOptions HDR -> Image r cs e -> ByteString #

ColorSpace cs e => Readable HDR (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: HDR -> ReadOptions HDR -> ByteString -> Image S cs e #

(ColorSpace cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto HDR) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto HDR -> WriteOptions (Auto HDR) -> Image r cs e -> ByteString #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto HDR) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto HDR -> ReadOptions (Auto HDR) -> ByteString -> Image r cs e #

type ReadOptions HDR # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions HDR = ()
type WriteOptions HDR # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions HDR = ()

JPG

data JPG #

Joint Photographic Experts Group image with .jpg or .jpeg extension.

Constructors

JPG 
Instances
Show JPG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> JPG -> ShowS #

show :: JPG -> String #

showList :: [JPG] -> ShowS #

FileFormat JPG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions JPG :: * #

type WriteOptions JPG :: * #

Methods

ext :: JPG -> String #

exts :: JPG -> [String] #

isFormat :: String -> JPG -> Bool #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable JPG (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: JPG -> WriteOptions JPG -> Image r cs e -> ByteString #

ColorSpace cs e => Readable JPG (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: JPG -> ReadOptions JPG -> ByteString -> Image S cs e #

(ColorSpace cs e, ToYCbCr cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto JPG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto JPG -> WriteOptions (Auto JPG) -> Image r cs e -> ByteString #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto JPG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto JPG -> ReadOptions (Auto JPG) -> ByteString -> Image r cs e #

type ReadOptions JPG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions JPG = ()
type WriteOptions JPG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

woSetQualityJPG :: Word8 -> WriteOptionsJPG -> WriteOptionsJPG #

Set the image quality, supplied value will be clamped to [0, 100] range. This setting directly affects the Jpeg compression level.

PNG

data PNG #

Portable Network Graphics image with .png extension.

Constructors

PNG 
Instances
Show PNG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> PNG -> ShowS #

show :: PNG -> String #

showList :: [PNG] -> ShowS #

FileFormat PNG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions PNG :: * #

type WriteOptions PNG :: * #

Methods

ext :: PNG -> String #

exts :: PNG -> [String] #

isFormat :: String -> PNG -> Bool #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable PNG (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: PNG -> WriteOptions PNG -> Image r cs e -> ByteString #

ColorSpace cs e => Readable PNG (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: PNG -> ReadOptions PNG -> ByteString -> Image S cs e #

(ColorSpace cs e, ToYA cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto PNG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto PNG -> WriteOptions (Auto PNG) -> Image r cs e -> ByteString #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PNG) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto PNG -> ReadOptions (Auto PNG) -> ByteString -> Image r cs e #

type ReadOptions PNG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions PNG = ()
type WriteOptions PNG # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions PNG = ()

TGA

data TGA #

Truevision Graphics Adapter image with .tga extension.

Constructors

TGA 
Instances
Show TGA # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> TGA -> ShowS #

show :: TGA -> String #

showList :: [TGA] -> ShowS #

FileFormat TGA # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TGA :: * #

type WriteOptions TGA :: * #

Methods

ext :: TGA -> String #

exts :: TGA -> [String] #

isFormat :: String -> TGA -> Bool #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TGA (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TGA -> WriteOptions TGA -> Image r cs e -> ByteString #

ColorSpace cs e => Readable TGA (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TGA -> ReadOptions TGA -> ByteString -> Image S cs e #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TGA) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TGA -> WriteOptions (Auto TGA) -> Image r cs e -> ByteString #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TGA) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TGA -> ReadOptions (Auto TGA) -> ByteString -> Image r cs e #

type ReadOptions TGA # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions TGA = ()
type WriteOptions TGA # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions TGA = ()

TIF

data TIF #

Tagged Image File Format image with .tif or .tiff extension.

Constructors

TIF 
Instances
Show TIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> TIF -> ShowS #

show :: TIF -> String #

showList :: [TIF] -> ShowS #

FileFormat TIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TIF :: * #

type WriteOptions TIF :: * #

Methods

ext :: TIF -> String #

exts :: TIF -> [String] #

isFormat :: String -> TIF -> Bool #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TIF (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TIF -> WriteOptions TIF -> Image r cs e -> ByteString #

ColorSpace cs e => Readable TIF (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TIF -> ReadOptions TIF -> ByteString -> Image S cs e #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TIF -> WriteOptions (Auto TIF) -> Image r cs e -> ByteString #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TIF) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TIF -> ReadOptions (Auto TIF) -> ByteString -> Image r cs e #

type ReadOptions TIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions TIF = ()
type WriteOptions TIF # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions TIF = ()

JuciyPixels conversion

To JuicyPixels

toAnyCS :: forall r' cs' e' r cs e. (Source r' Ix2 (Pixel cs' e'), Mutable r Ix2 (Pixel cs e), Storable (Pixel cs e), ColorSpace cs e, ToYA cs' e', ToRGBA cs' e', ToHSIA cs' e', ToCMYKA cs' e', ToYCbCrA cs' e') => Image r' cs' e' -> Maybe (Image r cs e) #

From JuicyPixels

fromDynamicImage :: forall cs e. (ColorSpace cs e, Source S Ix2 (Pixel cs e)) => DynamicImage -> Maybe (Image S cs e) #

Netpbm formats

PBM

data PBM #

Netpbm: portable bitmap image with .pbm extension.

Constructors

PBM 
Instances
Show PBM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

showsPrec :: Int -> PBM -> ShowS #

show :: PBM -> String #

showList :: [PBM] -> ShowS #

FileFormat PBM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PBM :: * #

type WriteOptions PBM :: * #

Methods

ext :: PBM -> String #

exts :: PBM -> [String] #

isFormat :: String -> PBM -> Bool #

ColorSpace cs e => Readable PBM (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PBM -> ReadOptions PBM -> ByteString -> Image S cs e #

FileFormat (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: * #

type WriteOptions (Sequence (Auto PBM)) :: * #

FileFormat (Sequence PBM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PBM) :: * #

type WriteOptions (Sequence PBM) :: * #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PBM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PBM -> ReadOptions (Auto PBM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PBM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PBM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PBM = ()
type WriteOptions PBM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions PBM = ()
type ReadOptions (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PBM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PBM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PBM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

PGM

data PGM #

Netpbm: portable graymap image with .pgm extension.

Constructors

PGM 
Instances
Show PGM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

showsPrec :: Int -> PGM -> ShowS #

show :: PGM -> String #

showList :: [PGM] -> ShowS #

FileFormat PGM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PGM :: * #

type WriteOptions PGM :: * #

Methods

ext :: PGM -> String #

exts :: PGM -> [String] #

isFormat :: String -> PGM -> Bool #

ColorSpace cs e => Readable PGM (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PGM -> ReadOptions PGM -> ByteString -> Image S cs e #

FileFormat (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: * #

type WriteOptions (Sequence (Auto PGM)) :: * #

FileFormat (Sequence PGM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PGM) :: * #

type WriteOptions (Sequence PGM) :: * #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PGM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PGM -> ReadOptions (Auto PGM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PGM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PGM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PGM = ()
type WriteOptions PGM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions PGM = ()
type ReadOptions (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PGM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PGM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PGM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

PPM

data PPM #

Netpbm: portable pixmap image with .ppm extension.

Constructors

PPM 
Instances
Show PPM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

showsPrec :: Int -> PPM -> ShowS #

show :: PPM -> String #

showList :: [PPM] -> ShowS #

FileFormat PPM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PPM :: * #

type WriteOptions PPM :: * #

Methods

ext :: PPM -> String #

exts :: PPM -> [String] #

isFormat :: String -> PPM -> Bool #

ColorSpace cs e => Readable PPM (Image S cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PPM -> ReadOptions PPM -> ByteString -> Image S cs e #

FileFormat (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: * #

type WriteOptions (Sequence (Auto PPM)) :: * #

FileFormat (Sequence PPM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PPM) :: * #

type WriteOptions (Sequence PPM) :: * #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PPM) (Image r cs e) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PPM -> ReadOptions (Auto PPM) -> ByteString -> Image r cs e #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PPM) (Array B Ix1 (Image S cs e)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PPM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PPM = ()
type WriteOptions PPM # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions PPM = ()
type ReadOptions (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PPM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PPM)) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PPM) # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Encoding and decoding of images is done using JuicyPixels and netpbm packages.

List of image formats that are currently supported, and their exact ColorSpaces and precision for reading and writing without an implicit conversion: