JPEG DCT coefficients access in C
This provides access via an array to the DCT coefficients which can then be modified before being re-saved as another JPEG. It depends on the IJG JPEG library (or libjpeg) which can be found here: http://www.ijg.org/
./jpegquant -q 2 lena.q100.jpg lena.q100.jq02.jpg
[175851]
butteraugli: 0.776085
jpeg-compare -m sum -n lena.q100.jpg lena.q100.jq02.jpg
SUM: 0.945429 (UM) # > 0.93 (HIGH)
./jpegquant -q 4 lena.q100.jpg lena.q100.jq04.jpg
[127572]
butteraugli: 1.300308
jpeg-compare -m sum -n lena.q100.jpg lena.q100.jq04.jpg
SUM: 0.833405 (UM) # > 0.76 (MEDIUM)
./jpegquant -q 10 lena.q100.jpg lena.q100.jq10.jpg
jpeg-compare -m sum -n lena.q100.jpg lena.q100.jq10.jpg
SUM: 0.574876 (UM) # > 0.50 (LOW)
./jpegquant -q 20 lena.q100.jpg lena.q100.jq20.jpg
jpeg-compare -m sum -n lena.q100.jpg lena.q100.jq20.jpg
SUM: 0.367628 (UM) # < 0.50 (DIRTY)
See all sample files for JPEGquant.
- https://github.com/kud/jpegrescan
- https://github.com/ImageProcessing-ElectronicPublications/jpeg-recompress
Copyright (C) 2012, Owen Campbell-Moore.
Modify 2019-2023, zvezdochiot
Public Domain Mark 1.0
https://github.com/ImageProcessing-ElectronicPublications/jpegquant