https://github.com/adrianklessa/svd-image-compression
SVD image compression
https://github.com/adrianklessa/svd-image-compression
data-compression image-compression singular-value-decomposition svd
Last synced: 9 months ago
JSON representation
SVD image compression
- Host: GitHub
- URL: https://github.com/adrianklessa/svd-image-compression
- Owner: AdrianKlessa
- Created: 2023-10-15T14:57:42.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T15:45:06.000Z (almost 2 years ago)
- Last Synced: 2025-06-23T03:44:55.757Z (9 months ago)
- Topics: data-compression, image-compression, singular-value-decomposition, svd
- Language: Python
- Homepage:
- Size: 10 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SVD-Image-Compression
A simple example of using Singular Value Decomposition for image compression. The example below is compressed by 76% (from a (710, 946, 3) uint8 numpy array to 9 2D arrays using the float64 datatype).
(2MB to 472 KB)
(710x946x3x8 bits to 71x95x9x64 bits)
Original:

Compressed:

Compression rate is controlled with the `compression_factor` global variable, determining the percentage of singular values to be used.
More compression would likely be achieved with minimal quality loss by forcing usage of lower-precision datatypes than the default float64.