Lossy image codec using discrete wavelet transform.
It supports/implements:
- Deslauriers-Dubuc 13/7 and CDF 5/3, wavelets.
- Configurable quality loss (showcase below).
- 8 bits per component. 4 channels.
- Reversible YCoCg color transformation.
- Elias coding + Rle compression. Nonetheless can handle ratios of 1:12 before artifacts became visible.
- Good performance. There is care on cache and memory usage.
- Everything is done with integers, ensuring always identical outputs (even in lossy compression).
And in an experimental state:
- Lossless compression.
12:1 (327.74 kB) | 24:1 (163.12 kB) | 48:1 (81.86 kB) |
---|---|---|
![]() |
![]() |
![]() |
- From Rec. ITU-T T.24, 50% resized.
- Uncompressed: 3932.16 kB (3.9 MB), 1024x1280 px.
12:1 (973.95 kB) | 24:1 (506.31 kB) | 48:1 (252.05 kB) |
---|---|---|
![]() |
![]() |
![]() |
- From UNISI & UNIFI Dataset, University of Siena, 50% resized.
- Uncompressed: 12063.74 kB (12 MB), 1632x2464 px.
Aside from C and C++ compilers (later only needed to build executable tools), the only requirement is cmake. On Ubuntu you can install it with:
sudo apt install cmake
Then compile with:
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
Two executables: akoenc
and akodec
will let you try the codec. Run them without any argument to read the usage help. But, in most cases is:
akoenc -q 16 -i "input.png" -o "out.ako"
- Where
-q 16
is the quantization step that controls loss. - There is also a noise gate, with
-g 16
, it can be used as a denoiser to help with compression. It is possible to use both, or disable either one with a value of zero.
At the end of the day this is a toy-project, it's me having fun while learning how image codecs work. So, my thanks to following authors:
- ADAMS, Michael David (2002). Reversible Integer-to-integer Wavelet Transforms For Image Coding. University of British Columbia.
- ARNTZEN, Hans-Kristian (2014). Linelet, an Ultra-Low Complexity, Ultra-Low Latency Video Codec for Adaptation of HD-SDI to Ethernet. Norwegian University of Science and Technology Department of Electronics and Telecommunications.
- CHRISTOPOULOS, Charilaos, SKODRAS, Athanassios & EBRAHIMI, Touradj (2000). The JPEG2000 Still Image Coding System: An Overview. IEEE Transactions on Consumer Electronics, Vol. 46, No. 4, pp. 1103-1127.
- DAUBECHIES, Ingrid & SWELDENS, Wim (1998). Factoring Wavelet Transforms Into Lifting Steps. The Journal of Fourier Analysis and Applications 4, pp. 247โ269.
- FYFFE, Graham (2016). GFWX: Good, Fast Wavelet Codec. ICT Tech Report ICT-TR-01-2016. University of Southern California Institute.
- KIELY, A., KLIMESH, M. (2003). The ICER Progressive Wavelet Image Compressor. IPN Progress Report 42-155.
- ? (2008 September 23). Dirac Specification Version 2.2.3.
And in the early days of the project, when terms like "lift" and "dyadic" were incredible obscure, hardware oriented papers gave me an invaluable help:
- AL-AZAWI, Saad, ABBAS, Yasir Amer & JIDIN, Razali. (2014). Low Complexity Multidimensional CDF 5/3 DWT Architecture. 9th International Symposium on Communication Systems, Networks & Digital Sign (CSNDSP).
- ANGELOPOULOU, Maria, CHEUNG, Peter, MASSELOS, Konstantinos & ANDREOPOULOS, Yiannis (2008). Implementation and Comparison of the 5/3 Lifting 2D Discrete Wavelet Transform Computation Schedules on FPGAs. Journal of VLSI Signal Processing. pp. 3-21.
- HEDGE, Shriram & RAMACHADRAN, S. (2014). Implementation of CDF 5/3 Wavelet Transform. International Journal of Electrical, Electronics and Data Communication. Vol. 2, No. 11, pp. 36-38.
Not directly related, but influencing the project:
- HANS, Mat & SCHAFER, Ronald (1999). Lossless Compression of Digital Audio. HP Laboratories Palo Alto.
- ROBINSON, Tony (1994). Shorten: Simple Lossless And Near-Lossless Waveform Compression. Cambridge University Engineering Department Technical Report CUED/F-INFENG/TR156.
- WEINBERGER, Marcelo, SEROUSSI, Gadiel & SAPIRO, Guillermo (2000). The LOCO-I Lossless Image Compression Algorithm: Principles and Standardization into JPEG-LS. IEEE Transactions on Image Processing, Vol. 9, No. 8, pp. 1309-1324.
- ? (????). FLAC Format Specification. Retrieved from: https://xiph.org/flac/format.html.
Source code under MIT License. Terms specified in LICENSE.
Each file includes the respective notice at the beginning.