jpeg-turbo

2020-12-20

libjpeg-turbo wrapper for Common Lisp

Upstream URL

github.com/shamazmazum/jpeg-turbo

Author

Vasily Postnicov <shamaz.mazum@gmail.com>

Maintainer

Vasily Postnicov <shamaz.mazum@gmail.com>

License

2-clause BSD
README

jpeg-turbo

Build Status CI

jpeg-turbo is a Common Lisp wrapper for libjpeg-turbo library which provides TurboJPEG API for compressing and decompressing JPEG images. To build this wrapper make sure that both libjpeg-turbo library and headers are installed (on FreeBSD this is done by installing graphics/libjpeg-turbo port).

Examples

Read header of an image (get width, height, subsampling mode and colorspace):

(with-decompressor (handle)
    (decompress-header handle "example.jpg"))

Decode a whole image, converting it to grayscale:

(with-decompressor (handle)
    (decompress handle "example.jpg"
                :pixel-format :gray))

Encode an image contained in array. Each pixel is encoded in three elements of the array. These elements must be red, green and blue components of the pixel.

(with-compressor (handle)
    (compress handle "example.jpg" array
              width height :rgb))

Documentation

Visit the project page. If you want a local copy, run (codex:document :jpeg-turbo :skip-undocumented t).

TODO

Add transformation API

Dependencies (2)

  • cffi
  • fiveam

Dependents (1)

  • GitHub
  • Quicklisp