Compression of images is an incredibly important process which occurs millions of times every day, images by themselves are simply too large to be shared or stored efficiently despite the advancements in storage due to the fact that they are essentially a 2D matrix of bits it’s still too large.
That is the reason people are continuously developing better algorithms for compression of the image as well as maintaining a low loss percentage. This project’s aims are to explore efficient algorithms that can be used for this same process.
In the scope of this project, we applied SVD to images converted to matrices and later dropped trailing singular values to cause “lossy” compression.
pip install -r requirements.txt
- Run
compressor.py
An initial image of size 142217 Bytes of dimensions 960 x 1280 was passed through the compression algorithm for various values of different number of columns (k). The size of each of the obtained output images are recorded.
K | COMPRESSION FACTOR | SIZE OF COMPRESSED IMAGE (Bytes) |
---|---|---|
1 | 3.12 | 45578 |
5 | 2.17 | 65525 |
10 | 1.84 | 77284 |
25 | 1.44 | 98740 |
50 | 1.26 | 112983 |
75 | 1.15 | 123735 |
100 | 1.09 | 129201 |
An initial image of size 883866 Bytes of dimensions 2048 x 2048 was passed through the compression algorithm for various values of different number of columns (k). The size of each of the obtained output images are recorded.
K | COMPRESSION FACTOR | SIZE OF COMPRESSED IMAGE (Bytes) |
---|---|---|
1 | 11.19 | 78990 |
5 | 8.43 | 104908 |
10 | 9.53 | 92684 |
25 | 8.49 | 104019 |
50 | 7.44 | 118760 |
75 | 6.08 | 145386 |
100 | 5.29 | 167051 |
- https://ieeexplore.ieee.org/abstract/document/1093309
- https://www.cmi.ac.in/~ksutar/NLA2013/imagecompression.pdf
- https://web.stanford.edu/class/cme335/lecture6.pdf
- https://web.mit.edu/be.400/www/SVD/Singular_Value_Decomposition.htm
- Lossy image compression using singular value decomposition and wavelet difference reduction - ScienceDirect