https://github.com/shamazmazum/jpeg-turbo
Common Lisp wrapper for libjpeg-turbo
https://github.com/shamazmazum/jpeg-turbo
common-lisp images lisp
Last synced: 3 months ago
JSON representation
Common Lisp wrapper for libjpeg-turbo
- Host: GitHub
- URL: https://github.com/shamazmazum/jpeg-turbo
- Owner: shamazmazum
- License: bsd-2-clause
- Created: 2020-03-01T04:31:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-21T07:22:40.000Z (over 4 years ago)
- Last Synced: 2025-02-09T10:11:19.105Z (4 months ago)
- Topics: common-lisp, images, lisp
- Language: Common Lisp
- Size: 43 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jpeg-turbo
==========
[](https://cirrus-ci.com/github/shamazmazum/jpeg-turbo)
**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):
~~~~~~~~{.lisp}
(with-decompressor (handle)
(decompress-header handle "example.jpg"))
~~~~~~~~Decode a whole image, converting it to grayscale:
~~~~~~~~{.lisp}
(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.
~~~~~~~~{.lisp}
(with-compressor (handle)
(compress handle "example.jpg" array
width height :rgb))
~~~~~~~~## Documentation
Visit the [project page](http://shamazmazum.github.io/jpeg-turbo). If
you want a local copy, run
`(codex:document :jpeg-turbo :skip-undocumented t)`.## TODO
Add transformation API