Load an image file without even thinking about it, it does everything as decodeImage
ModuleJuicyPixels-3.3.8Haskell2010
Codec.Picture
Main module for image import/export into various image formats.
To use the library without thinking about it, look after decodeImage and readImage.
Generally, the read* functions read the images from a file and try to decode
it, and the decode* functions try to decode a bytestring.
For an easy image writing use the saveBmpImage, saveJpgImage & savePngImage functions
- 22 types
- 5 classes
- 66 values
- PackageJuicyPixels-3.3.8
- Exports94
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourcePicture.hs
Generic functions
12 declarationsEquivalent to readImage but also providing metadatas.
If you want to decode an image in a bytestring without even thinking in term of format or whatever, this is the function to use. It will try to decode in each known format and if one decoding succeeds, it will return the decoded image in it's own colorspace.
Equivalent to decodeImage, but also provide potential metadatas present in the given file.
Equivalent to decodeImage, but also provide potential metadatas present in the given file and the palettes if the format provides them.
map equivalent for an image, working at the pixel level. Little example : a brightness function for an rgb image
brightnessRGB8 :: Int -> Image PixelRGB8 -> Image PixelRGB8
brightnessRGB8 add = pixelMap brightFunction
where up v = fromIntegral (fromIntegral v + add)
brightFunction (PixelRGB8 r g b) =
PixelRGB8 (up r) (up g) (up b)Helper function to help extract information from dynamic image. To get the width of a dynamic image, you can use the following snippet:
dynWidth :: DynamicImage -> Int
dynWidth img = dynamicMap imageWidth imgEquivalent of the pixelMap function for the dynamic images. You can perform pixel colorspace independant operations with this function.
For instance, if you want to extract a square crop of any image, without caring about colorspace, you can use the following snippet.
dynSquare :: DynamicImage -> DynamicImage
dynSquare = dynamicPixelMap squareImage
squareImage :: Pixel a => Image a -> Image a
squareImage img = generateImage (\x y -> pixelAt img x y) edge edge
where edge = min (imageWidth img) (imageHeight img)generateImage Create an image given a function to generate pixels. The function will receive values from 0 to width-1 for the x parameter and 0 to height-1 for the y parameter. The coordinates 0,0 are the upper left corner of the image, and (width-1, height-1) the lower right corner.
for example, to create a small gradient image:
imageCreator :: String -> IO ()
imageCreator path = writePng path $ generateImage pixelRenderer 250 300
where pixelRenderer x y = PixelRGB8 (fromIntegral x) (fromIntegral y) 128generateFoldImage Create an image given a function to generate pixels. The function will receive values from 0 to width-1 for the x parameter and 0 to height-1 for the y parameter. The coordinates 0,0 are the upper left corner of the image, and (width-1, height-1) the lower right corner.
the acc parameter is a user defined one.
The function is called for each pixel in the line from left to right (0 to width - 1) and for each line (0 to height - 1).
withImage Create an image using a monadic initializer function. The function will receive values from 0 to width-1 for the x parameter and 0 to height-1 for the y parameter. The coordinates 0,0 are the upper left corner of the image, and (width-1, height-1) the lower right corner.
The function is called for each pixel in the line from left to right (0 to width - 1) and for each line (0 to height - 1).
Flatten a PalettedImage to a DynamicImage
RGB helper functions
3 declarationsConvert by any means possible a dynamic image to an image in RGB. The process can lose precision while converting from 16bits pixels or Floating point pixels. Any alpha layer will be dropped
Convert by any means possible a dynamic image to an image in RGB. The process can lose precision while converting from 32bits pixels or Floating point pixels. Any alpha layer will be dropped
Convert by any means possible a dynamic image to an image in RGBA. The process can lose precision while converting from 16bits pixels or Floating point pixels.
Lens compatibility
3 declarationsTraversal type matching the definition in the Lens package.
Traversal in "raster" order, from left to right the top to bottom. This traversal is matching pixelMap in spirit.
Since 3.2.4
imageIPixels :: (Pixel pxa, Pixel pxb) => Traversal (Image pxa) (Image pxb) (Int, Int, pxa) pxbTraversal providing the pixel position with it's value. The traversal in raster order, from lef to right, then top to bottom. The traversal match pixelMapXY in spirit.
Since 3.2.4
Generic image writing
6 declarationsSave an image to a '.bmp' file, will do everything it can to save an image.
Save an image to a '.jpg' file, will do everything it can to save an image.
Save an image to a '.gif' file, will do everything it can to save it.
Save an image to a '.png' file, will do everything it can to save an image. For example, a simple transcoder to png
transcodeToPng :: FilePath -> FilePath -> IO ()
transcodeToPng pathIn pathOut = do
eitherImg <- readImage pathIn
case eitherImg of
Left _ -> return ()
Right img -> savePngImage pathOut imgSave an image to a '.tiff' file, will do everything it can to save an image.
Save an image to a '.hdr' file, will do everything it can to save an image.
Specific image format functions
0 declarationsBitmap handling
All the instance of this class can be written as a bitmap file using this library.
Instances3BmpEncodable
BmpEncodable Pixel8Defined in JuicyPixels-3.3.8 · Codec.Picture.BitmapBmpEncodable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.BitmapBmpEncodable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.Bitmap
Write an image in a file use the bitmap format.
Encode an image into a bytestring in .bmp format ready to be written on disk.
Try to load a .bmp file. The colorspace would be RGB, RGBA or Y.
Try to decode a bitmap image. Right now this function can output the following image:
Encode a dynamic image in BMP if possible, supported images are:
Write a dynamic image in a .bmp image file if possible. The same restriction as encodeDynamicBitmap apply.
Gif handling
Helper function trying to load a gif file from a file on disk.
Helper function trying to load all the images of an animated gif file.
Transform a raw gif image to an image, without modifying the pixels. This function can output the following images:
Transform a raw gif to a list of images, representing all the images of an animation.
Encode a greyscale image to a bytestring.
Write a greyscale in a gif file on the disk.
Encode an image with a given palette. Can return errors if the palette is ill-formed.
A palette must have between 1 and 256 colors
Write a gif image with a palette to a file.
A palette must have between 1 and 256 colors
Encode a full color image to a gif by applying a color quantization algorithm on it.
Write a full color image to a gif by applying a color quantization algorithm on it.
Encode a gif animation to a bytestring.
Every image must have the same size
Every palette must have between one and 256 colors.
Write a list of images as a gif animation in a file.
Every image must have the same size
Every palette must have between one and 256 colors.
Gif animation
Delay to wait before showing the next Gif image. The delay is expressed in 100th of seconds.
Help to control the behaviour of GIF animation looping.
Constructors
LoopingNeverThe animation will stop once the end is reached
LoopingForeverThe animation will restart once the end is reached
LoopingRepeat Word16The animation will repeat n times before stoping
Helper function to create a gif animation. All the images of the animation are separated by the same delay.
Helper function to write a gif animation on disk. See encodeGifAnimation
Jpeg handling
Try to load 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 colorSpaceConversion.
Try to decompress and decode a jpeg file. 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 images:
Encode an image in jpeg at a reasonnable quality level. If you want better quality or reduced file size, you should use encodeJpegAtQuality
encodeJpegAtQuality :: Word8Quality factor
-> Image PixelYCbCr8Image to encode
-> ByteStringEncoded JPEG
Function to call to encode an image to jpeg. The quality factor should be between 0 and 100 (100 being the best quality).
Png handling
Encode an image into a png if possible.
Methods
encodePng :: Image a -> ByteStringTransform an image into a png encoded bytestring, ready to be written as a file.
encodePngWithMetadata :: Metadatas -> Image a -> ByteStringEncode a png using some metadatas. The following metadata keys will be stored in a
tEXtfield :Unknown using the key present in the constructor.
the followings metadata will be stored in the
gAMAchunk.The followings metadata will be stored in a
pHYschunk
Instances8PngSavable, …
PngSavable Pixel16Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable Pixel8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.Export
Helper function trying to load a png file from a file on disk.
Transform a raw png image to an image, without modifying the underlying pixel type. If the image is greyscale and < 8 bits, a transformation to RGBA8 is performed. This should change in the future. The resulting image let you manage the pixel types.
This function can output the following images:
Helper function to directly write an image as a png on disk.
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
Encode a dynamic image in PNG if possible, supported images are:
Write a dynamic image in a .png image file if possible. The same restriction as encodeDynamicPng apply.
TGA handling
Try to load a .tga file from disk.
Transform a raw tga image to an image, without modifying the underlying pixel type.
This function can output the following images:
This typeclass determine if a pixel can be saved in the TGA format.
Instances3TgaSaveable
TgaSaveable Pixel8Defined in JuicyPixels-3.3.8 · Codec.Picture.TgaTgaSaveable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TgaTgaSaveable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.Tga
Transform a compatible image to a raw bytestring representing a Targa file.
Helper function to directly write an image a tga on disk.
Tiff handling
Helper function trying to load tiff file from a file on disk.
Class defining which pixel types can be serialized in a Tiff file.
Instances13TiffSaveable, …
TiffSaveable Pixel16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable Pixel32Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable Pixel8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelFDefined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffTiffSaveable PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.Tiff
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:
Transform an image into a Tiff encoded bytestring, ready to be written as a file.
Helper function to directly write an image as a tiff on disk.
HDR (Radiance/RGBE) handling
Try to load a .pic file. The colorspace can only be RGB with floating point precision.
Decode an HDR (radiance) image, the resulting image can be:
Encode an High dynamic range image into a radiance image file format. Alias for encodeRawHDR
Write an High dynamic range image into a radiance image file on disk.
Color Quantization
Define which palette creation method is used.
Constructors
MedianMeanCutMedianMeanCut method, provide the best results (visualy) at the cost of increased calculations.
UniformVery fast algorithm (one pass), doesn't provide good looking results.
To specify how the palette will be created.
Constructors
PaletteOptionspaletteCreationMethod :: PaletteCreationMethodAlgorithm used to find the palette
enableImageDithering :: BoolDo we want to apply the dithering to the image. Enabling it often reduce compression ratio but enhance the perceived quality of the final image.
paletteColorCount :: IntMaximum number of color we want in the palette
Reduces an image to a color palette according to PaletteOptions and returns the indices image along with its Palette.
Image types and pixel types
0 declarationsImage
The main type of this package, one that most functions work on, is Image.
Parameterized by the underlying pixel format it forms a rigid type. If you wish to store images of different or unknown pixel formats use DynamicImage.
Image is essentially a rectangular pixel buffer of specified width and height. The coordinates are assumed to start from the upper-left corner of the image, with the horizontal position first and vertical second.
Constructors
ImageimageWidth :: !IntWidth of the image in pixels
imageHeight :: !IntHeight of the image in pixels.
imageData :: Vector (PixelBaseComponent a)Image pixel data. To extract pixels at a given position you should use the helper functions.
Internally pixel data is stored as consecutively packed lines from top to bottom, scanned from left to right within individual lines, from first to last color component within each pixel.
Instances2Eq, NFData
(Eq (PixelBaseComponent a), Storable (PixelBaseComponent a)) => Eq (Image a)Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesNFData (Image a)Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Image type enumerating all predefined pixel types. It enables loading and use of images of different pixel types.
Constructors
ImageY8 (Image Pixel8)A greyscale image.
ImageY16 (Image Pixel16)A greyscale image with 16bit components
ImageY32 (Image Pixel32)A greyscale image with 32bit components
ImageYF (Image PixelF)A greyscale HDR image
ImageYA8 (Image PixelYA8)An image in greyscale with an alpha channel.
ImageYA16 (Image PixelYA16)An image in greyscale with alpha channel on 16 bits.
ImageRGB8 (Image PixelRGB8)An image in true color.
ImageRGB16 (Image PixelRGB16)An image in true color with 16bit depth.
ImageRGBF (Image PixelRGBF)An image with HDR pixels
ImageRGBA8 (Image PixelRGBA8)An image in true color and an alpha channel.
ImageRGBA16 (Image PixelRGBA16)A true color image with alpha on 16 bits.
ImageYCbCr8 (Image PixelYCbCr8)An image in the colorspace used by Jpeg images.
ImageCMYK8 (Image PixelCMYK8)An image in the colorspace CMYK
ImageCMYK16 (Image PixelCMYK16)An image in the colorspace CMYK and 16 bits precision
Instances2Eq, NFData
Eq DynamicImageDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesNFData DynamicImageDefined in JuicyPixels-3.3.8 · Codec.Picture.Types
Type for the palette used in Gif & PNG files.
Pixels
Definition of pixels used in images. Each pixel has a color space, and a representative component (Word8 or Float).
Associated types
type family PixelBaseComponent aType of the pixel component, "classical" images would have Word8 type as their PixelBaseComponent, HDR image would have Float for instance
Methods
mixWith :: (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> a -> a -> aCall the function for every component of the pixels. For example for RGB pixels mixWith is declared like this:
mixWith f (PixelRGB8 ra ga ba) (PixelRGB8 rb gb bb) = PixelRGB8 (f 0 ra rb) (f 1 ga gb) (f 2 ba bb)mixWithAlpha :: (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> (PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> a -> a -> aExtension of the mixWith which separate the treatment of the color components of the alpha value (transparency component). For pixel without alpha components, it is equivalent to mixWith.
mixWithAlpha f fa (PixelRGBA8 ra ga ba aa) (PixelRGB8 rb gb bb ab) = PixelRGBA8 (f 0 ra rb) (f 1 ga gb) (f 2 ba bb) (fa aa ab)pixelOpacity :: a -> PixelBaseComponent aReturn the opacity of a pixel, if the pixel has an alpha layer, return the alpha value. If the pixel doesn't have an alpha value, return a value representing the opaqueness.
componentCount :: a -> IntReturn the number of components of the pixel
colorMap :: (PixelBaseComponent a -> PixelBaseComponent a) -> a -> aApply a function to each component of a pixel. If the color type possess an alpha (transparency channel), it is treated like the other color components.
pixelBaseIndex :: Image a -> Int -> Int -> IntCalculate the index for the begining of the pixel
mutablePixelBaseIndex :: MutableImage s a -> Int -> Int -> IntCalculate theindex for the begining of the pixel at position x y
pixelAt :: Image a -> Int -> Int -> aExtract a pixel at a given position, (x, y), the origin is assumed to be at the corner top left, positive y to the bottom of the image
readPixel :: PrimMonad m => MutableImage (PrimState m) a -> Int -> Int -> m aSame as pixelAt but for mutable images.
writePixel :: PrimMonad m => MutableImage (PrimState m) a -> Int -> Int -> a -> m ()Write a pixel in a mutable image at position x y
unsafePixelAt :: Vector (PixelBaseComponent a) -> Int -> aUnsafe version of pixelAt, read a pixel at the given index without bound checking (if possible). The index is expressed in number (PixelBaseComponent a)
unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent a) -> Int -> m aUnsafe version of readPixel, read a pixel at the given position without bound checking (if possible). The index is expressed in number (PixelBaseComponent a)
unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent a) -> Int -> a -> m ()Unsafe version of writePixel, write a pixel at the given position without bound checking. This can be _really_ unsafe. The index is expressed in number (PixelBaseComponent a)
Instances15Pixel, …
Pixel Pixel16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel Pixel32Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel Pixel8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelYCbCrK8Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Type alias for 8bit greyscale pixels. For simplicity, greyscale pixels use plain numbers instead of a separate type.
Type alias for 16bit greyscale pixels.
Type alias for 32bit greyscale pixels.
Type alias for 32bit floating point greyscale pixels. The standard bounded value range is mapped to the closed interval [0,1] i.e.
map promotePixel [0, 1 .. 255 :: Pixel8] == [0/255, 1/255 .. 1.0 :: PixelF]Pixel type storing 8bit Luminance (Y) and alpha (A) information. Values are stored in the following order:
Luminance
Alpha
Instances18Eq, Ord, Show, PngSavable, TiffSaveable, Pixel, …
Eq PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPngSavable PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportTiffSaveable PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesLumaPlaneExtractable PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPackeablePixel PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelYA16 PixelYA8Defined in JuicyPixels-3.3.8 · Codec.PictureColorConvertible Pixel8 PixelYA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA8 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA8 PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelYA8 PlaneAlphaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelYA8 PlaneLumaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesTransparentPixel PixelYA8 Pixel8Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelYA8 = Word8Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PackedRepresentation PixelYA8 = Word16Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Pixel type storing 16bit Luminance (Y) and alpha (A) information. Values are stored in the following order:
Luminance
Alpha
Instances16Eq, Ord, Show, PngSavable, TiffSaveable, Pixel, …
Eq PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPngSavable PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportTiffSaveable PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPackeablePixel PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelYA16 PixelYA8Defined in JuicyPixels-3.3.8 · Codec.PictureColorConvertible Pixel16 PixelYA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA16 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA16 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelYA16 PlaneAlphaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelYA16 PlaneLumaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesTransparentPixel PixelYA16 Pixel16Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelYA16 = Word16Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PackedRepresentation PixelYA16 = Word32Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Classic pixel type storing 8bit red, green and blue (RGB) information. Values are stored in the following order:
Red
Green
Blue
Instances29Eq, Ord, Show, BmpEncodable, PngPaletteSaveable, PngSavable, …
Eq PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesBmpEncodable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.BitmapPngPaletteSaveable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportTgaSaveable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TgaTiffSaveable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesJpgEncodable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.JpgLumaPlaneExtractable PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelRGB16 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.PictureDecimable PixelRGBF PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.PictureColorSpaceConvertible PixelCMYK8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelRGB8 PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelRGB8 PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelYCbCr8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelYCbCrK8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible Pixel8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGB8 PlaneBlueDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGB8 PlaneGreenDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGB8 PlaneRedDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesTransparentPixel PixelRGBA8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelRGB8 = Word8Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Pixel type storing 16bit red, green and blue (RGB) information. Values are stored in the following order:
Red
Green
Blue
Constructors
Instances22Eq, Ord, Show, PngSavable, TiffSaveable, Pixel, …
Eq PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPngSavable PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportTiffSaveable PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesLumaPlaneExtractable PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelRGB16 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.PictureDecimable PixelRGBF PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.PictureColorSpaceConvertible PixelCMYK16 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelRGB16 PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible Pixel16 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible Pixel8 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB16 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA16 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA8 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGB16 PlaneBlueDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGB16 PlaneGreenDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGB16 PlaneRedDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesTransparentPixel PixelRGBA16 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelRGB16 = Pixel16Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
HDR pixel type storing floating point 32bit red, green and blue (RGB) information. Same value range and comments apply as for PixelF. Values are stored in the following order:
Red
Green
Blue
Instances13Eq, Ord, Show, Pixel, LumaPlaneExtractable, Decimable, …
Eq PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesPixel PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesLumaPlaneExtractable PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelRGBF PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.PictureDecimable PixelRGBF PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.PictureColorConvertible PixelF PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGBFDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBF PlaneBlueDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBF PlaneGreenDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBF PlaneRedDefined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelRGBF = PixelFDefined in JuicyPixels-3.3.8 · Codec.Picture.Types
Classical pixel type storing 8bit red, green, blue and alpha (RGBA) information. Values are stored in the following order:
Red
Green
Blue
Alpha
Constructors
Instances23Eq, Ord, Show, BmpEncodable, PngPaletteSaveable, PngSavable, …
Eq PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesBmpEncodable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.BitmapPngPaletteSaveable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportPngSavable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportTgaSaveable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TgaTiffSaveable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesLumaPlaneExtractable PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPackeablePixel PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelRGBA16 PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.PictureColorConvertible Pixel8 PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGBA8 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA8 PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA8 PlaneAlphaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA8 PlaneBlueDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA8 PlaneGreenDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA8 PlaneRedDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesTransparentPixel PixelRGBA8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelRGBA8 = Word8Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PackedRepresentation PixelRGBA8 = Word32Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Pixel type storing 16bit red, green, blue and alpha (RGBA) information. Values are stored in the following order:
Red
Green
Blue
Alpha
Constructors
Instances20Eq, Ord, Show, PngSavable, TiffSaveable, Pixel, …
Eq PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPngSavable PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.Png.Internal.ExportTiffSaveable PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPackeablePixel PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelRGBA16 PixelRGBA8Defined in JuicyPixels-3.3.8 · Codec.PictureColorConvertible Pixel16 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB16 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGB8 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelRGBA8 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorConvertible PixelYA16 PixelRGBA16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA16 PlaneAlphaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA16 PlaneBlueDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA16 PlaneGreenDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelRGBA16 PlaneRedDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesTransparentPixel PixelRGBA16 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelRGBA16 = Pixel16Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PackedRepresentation PixelRGBA16 = Word64Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Pixel type storing 8bit luminance, blue difference and red difference (YCbCr) information. Values are stored in the following order:
Y (luminance)
Cb
Cr
Constructors
Instances13Eq, Ord, Show, TiffSaveable, Pixel, JpgEncodable, …
Eq PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesTiffSaveable PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesJpgEncodable PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.JpgLumaPlaneExtractable PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelRGB8 PixelYCbCr8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelYCbCr8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelYCbCr8 PlaneCbDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelYCbCr8 PlaneCrDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelYCbCr8 PlaneLumaDefined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelYCbCr8 = Word8Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Pixel type storing 8bit cyan, magenta, yellow and black (CMYK) information. Values are stored in the following order:
Cyan
Magenta
Yellow
Black
Constructors
Instances17Eq, Ord, Show, TiffSaveable, Pixel, JpgEncodable, …
Eq PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesTiffSaveable PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesJpgEncodable PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.JpgPackeablePixel PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelCMYK16 PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.PictureColorSpaceConvertible PixelCMYK8 PixelRGB8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelRGB8 PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelYCbCrK8 PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK8 PlaneBlackDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK8 PlaneCyanDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK8 PlaneMagentaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK8 PlaneYellowDefined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelCMYK8 = Word8Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PackedRepresentation PixelCMYK8 = Word32Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Pixel type storing 16bit cyan, magenta, yellow and black (CMYK) information. Values are stored in the following order:
Cyan
Magenta
Yellow
Black
Constructors
Instances15Eq, Ord, Show, TiffSaveable, Pixel, PackeablePixel, …
Eq PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesOrd PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesShow PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesTiffSaveable PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TiffPixel PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesPackeablePixel PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesDecimable PixelCMYK16 PixelCMYK8Defined in JuicyPixels-3.3.8 · Codec.PictureColorSpaceConvertible PixelCMYK16 PixelRGB16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorSpaceConvertible PixelRGB16 PixelCMYK16Defined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK16 PlaneBlackDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK16 PlaneCyanDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK16 PlaneMagentaDefined in JuicyPixels-3.3.8 · Codec.Picture.TypesColorPlane PixelCMYK16 PlaneYellowDefined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PixelBaseComponent PixelCMYK16 = Word16Defined in JuicyPixels-3.3.8 · Codec.Picture.Typestype PackedRepresentation PixelCMYK16 = Word64Defined in JuicyPixels-3.3.8 · Codec.Picture.Types
Foreign unsafe import
1 declarationimageFromUnsafePtr :: (Pixel px, PixelBaseComponent px ~ Word8)=> IntWidth in pixels
-> IntHeight in pixels
-> ForeignPtr Word8Pointer to the raw data
-> Image px
Import a image from an unsafe pointer The pointer must have a size of width * height * componentCount px