Simple, single-file jpg compression implementation in under 1k lines of cpp.
Works only on ppm image format, and on image dimensions that are multiple of 64.
Create build dir
mkdir build && cd build
Build with cmake
cmake -DCMAKE_BUILD_TYPE=Release .. && make
Run
./jpg_encoder dog.ppm out.jpg 100
For sample dog image we get from 3.1MB to 162KB. 94.9% reduction!
TODO:
- more image formats supported
- more flexible dimension support