/Simple_CPP_Baseline_JPEG_Encoder

A baseline JPEG encoder implemented by C++.

Primary LanguageC++

Simple Baseline JPEG Encoder

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.

Building

Go to the repostiry directory and execute the following commands in shell:

$ mkdir build && cd build
$ cmake ..
$ make

Dependency

You need to install OpenCV to build the executable.

Usage

print help

$ ./cppeg -h

Compress Image into JPEG File

$ ./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.

Reference

[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]