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


Version on this page:
LTS Haskell 20.24:3.3.7
Stackage Nightly 2023-06-04:3.3.8
Latest on Hackage:3.3.8

See all snapshots JuicyPixels appears in

BSD-3-Clause licensed by Vincent Berthoux
This version can be pinned in stack with:JuicyPixels-,3844

Juicy logo

Build Status Hackage


This library provides saving & loading of different picture formats for the Haskell language. The aim of the library is to be as lightweight as possible, you ask it to load an image, and it’ll dump you a big Vector full of juicy pixels. Or squared pixels, or whatever, as long as they’re unboxed.


The library documentation can be accessed on Hackage


For the user of:


  • PNG (.png)

    • Reading

      • 1,2,4,8 bits loading, Grayscale, 24bits, 24 bits with alpha, interleaved & filtered (fully compliant with the standard, tested against png suite).
    • Writing

      • 8bits RGB (non interleaved)
      • 8bits RGBA (non interleaved)
      • 8bits greyscale (non interleaved)
      • 16bits greyscale (non interleaved)
      • 16bits RGB (non interleaved)
      • 16bits RGBA (non interleaved)
    • Metadata (reading/writing)

      • in a tEXT chunk: ‘Title’, ‘Description’, ‘Author’, ‘Copyright’, ‘Software’, ‘Comment’, ‘Disclaimer’, ‘Source’, ‘Warning’
      • any other tEXT chunk.
      • in a gAMA field : ‘Gamma’
      • DPI information in a pHYs chunk.
  • Bitmap (.bmp) (mainly used as a debug output format)

    • Reading

      • 32bits (RGBA) images
      • 24bits (RGB) images
      • 8bits (greyscale & paletted) images
    • Writing

      • 32bits (RGBA) per pixel images
      • 24bits (RGB) per pixel images
      • 8 bits greyscale (with palette)
    • Metadata (reading/writing): DPI information

  • Jpeg (.jpg, .jpeg)

    • Reading normal and interlaced baseline DCT image

      • YCbCr (default) CMYK/YCbCrK/RGB colorspaces
    • Writing non-interlaced JPG

      • YCbCr (favored), Y, RGB & CMYK colorspaces
    • Metadata:

      • Reading and writing DpiX & DpiY from JFIF header.
      • Reading EXIF metadata.
  • Gif (.gif)

    • Reading single image & animated Gif image, handles interlaced images.
    • Writing single & animated Gif images.
    • No metadata.
  • Radiance (.pic, .hdr)

    • Reading
    • Writing
    • No metadata.
  • Tga

    • Reading
      • 8, 16, 24 & 32 bits
      • paletted and unpaletted
      • RLE encoded or uncompressed
    • Writing
      • uncompressed 8bits (Pixel8)
      • uncompressed 24bits (PixelRGB8)
      • uncompressed 32bits (PixelRGBA8)
    • No metadata
  • Tiff

    • Reading

      • 2, 4, 8, 16 bit depth reading (planar and contiguous for each)
      • CMYK, YCbCr, RGB, RGBA, Paletted, Greyscale
      • Uncompressed, PackBits, LZW
    • Writing

      • 8 and 16 bits
      • CMYK, YCbCr, RGB, RGBA, Greyscale
      • Uncompressed
    • Metadata: reading DpiX, DpiY and EXIF informations.

I love juicy pixels

You can make donations on this page.