A simple, easy-to-use JPEG library, written in C++11.
This is a work in progress. Expect loads of bugs. There are no dependencies to build this project.
Only the decoder has been implemented till now.
libKPEG decodes a JFIF image file and
saves the uncompressed image to a PPM image in the same directory and while encoding,
takes as input a PPM image file and converts it to a corresponding JFIF file.
My goal of writing this library is to gain a better technical knowledge about JPEG image compression and also a self learning programming exercise. I have intentionally used naive programming constructs for better clarity, sacrificing speed.
NOTE: Only 8-bit Sequential Baseline DCT, grayscale/RGB, with no chroma subsampling (4:4:4) is supported as of now.
- Half complete, not yet functional.
- 8-bit Sequential Baseline, DCT, grayscale/RGB, no chroma subsampling (4:4:4)
$ git clone https://github.com/TheIllusionistMirage/libKPEG $ git mkdir build && cd build $ cmake .. $ make
$ ./kpeg -h
Decompress a JPEG file to uncompressed PPM format
To convert a JPEG image file called
some-image.jpg to its corresponding uncompressed PPM form:
$ ./kpeg some-image.jpg
A PPM image file called
some-image.ppm will be created in the same directory as the
Most images should work without any problems. And if some don't, they will eventually.
You can check out the
misc/screenshots directory for some screenshots I took with
- The official JPEG standard, ITU-T.81 (pdf)
- The official JFIF standard (pdf )
- Calvin Hass' excellent articles (blog posts)
- Cristi Cuturicu's JPEG Guide (txt)
Koushtav Chakrabarty ( aka TheIllusionistMirage )
Not decided yet