This goal of this repository is to provide simple codes of high readibility for fully understanding the encoding process of baseline JPEG. The implememtation was inspired by TheIllusionistMirage's JPEG decoder repository. Image processing related operations use OpenCV library for higher readibilty. You can refer to it's official documentation for more details.
Go to the repostiry directory and execute the following commands in shell:
$ mkdir build && cd build
$ cmake ..
$ make
You need to install OpenCV to build the executable.
$ ./cppeg -h
$ ./kpeg input_img_path [optional_output_path]
Suppose our input image's path is sample.jpg
and we don't denote the output path of the compressed JPEG file. Then, the output JPEG file will have the name sample_compressed.jpg
.
[1] Recommendation T.81 (09/92): Information technology—Digital compression and coding of continuous-tone still images—Requirements and guidelines
[2] Koushtav Chakrabarty's JPEG Decoder Guide [blog]
[3] OpenCV documentation [website]