unm-hip-0.0.0.1: A Library for the manipulation of images

Safe HaskellSafe-Inferred

Data.Image.IO

Synopsis

Documentation

class DisplayFormat df whereSource

A DisplayFormat for writing to a file

Methods

format :: df -> StringSource

class RealFrac (GrayVal px) => GrayPixel px whereSource

GrayPixels will be converted using this class

Associated Types

type GrayVal px :: *Source

Methods

toGray :: px -> GrayVal pxSource

class RealFrac (ColorVal px) => RGBPixel px whereSource

RGBPixels will be converted using this class

Associated Types

type ColorVal px :: *Source

Methods

toRGB :: px -> (ColorVal px, ColorVal px, ColorVal px)Source

writeImage :: DisplayFormat df => FilePath -> df -> IO ()Source

Given a file name and a formatable image, writes the image to that file with the format.

>>> frog <- readImage "images/frog.pgm"
>>> writeImage "transposeFrog.pgm" (transpose frog)

https://raw.github.com/jcollard/unm-hip/master/examples/frog.jpg

https://raw.github.com/jcollard/unm-hip/master/examples/transposefrog.jpg

>>> cactii <- readColorImage "images/cactii.ppm"
>>> writeImage "inverseCactii.ppm" (imageMap (*(-1)) cactii)

https://raw.github.com/jcollard/unm-hip/master/examples/cactii.jpg

https://raw.github.com/jcollard/unm-hip/master/examples/inversecactii.jpg

toPGM :: (Image img, GrayPixel (Pixel img)) => img -> [Char]Source

Converts an image an ASCII PPM scaled between pixel values of 0 and 255

toPPM :: (Image img, RGBPixel (Pixel img)) => img -> [Char]Source

Converts an image to an ASCII PPM scaled between pixel values of 0 and 255