Press enter or click to view image in full size
Created by Canva AI
The elegance, compromises, and possibilities of SVD-based compression
11 min readSep 12, 2025
–
Every day billions of images are created or uploaded or shared or stored. Think about the range of images we generate every day? From a selfie on your smartphone to the level of detail of an MRI scan to the billions of high resolution satellite images sent back to the Earth daily, it is suffocating how much visual information we generate each day, so much so that to attempt to cage it becomes a burden on digital infrastructure! It is estimated, conservatively, that more than 80% of all internet traffic around the world consists of images and videos.
Considering that each image is saved at full resolution would be im…
Press enter or click to view image in full size
Created by Canva AI
The elegance, compromises, and possibilities of SVD-based compression
11 min readSep 12, 2025
–
Every day billions of images are created or uploaded or shared or stored. Think about the range of images we generate every day? From a selfie on your smartphone to the level of detail of an MRI scan to the billions of high resolution satellite images sent back to the Earth daily, it is suffocating how much visual information we generate each day, so much so that to attempt to cage it becomes a burden on digital infrastructure! It is estimated, conservatively, that more than 80% of all internet traffic around the world consists of images and videos.
Considering that each image is saved at full resolution would be impossible for our digital world. Cloud storage would crash, data centers would choke, networks would no longer operate efficiently, and ecosystems such as Instagram, Netflix, or Youtube would simply cease to exist.
Image compression is the process of reducing the amount of bytes needed to represent an image and does so while balancing the file size, and, or perceptual quality of the image. The advantages of a reduced image size include faster loading time, less storage space utilization, and easier data transfer, as long as the image is fine for what the human eye can perceive, with some quality discrepancy from the original.
The compression, people are most familiar with is JPEG. Since the early 1990s, JPEG has been the standard for digital photography because it represents images in terms of discrete frequency components using the Discrete Cosine Transform (DCT). JPEG makes intelligent discards of frequencies at the photo-physical limits of human sensitivity when producing its compression levels. These intelligently discarded frequencies provide nice compression rates while also providing minimal visible loss.
Now, JPEG compression is not the only way to compress images. An elegant alternative to JPEG compression comes directly from linear algebra: the Singular Value Decomposition (SVD). Understandably, SVD will likely not become a standard JPEG-like image compression standard because SVD is universal, whereas JPEG compression is handmade. SVD is more than just an image compression method; it allows us to “compress” or approximate large matrices (an image) with small matrices that still maintain most of the essential information from the original image.
SVD is beautiful for two reasons. It shows that pure mathematics can solve a real-world problem in our modern framework and it provides flexibility; we can tune how many singular values we maintain to provide different qualities of approximation and compression.
This article will examine how SVD drives image compression. We will review:
· The mathematics of SVD and why rank-k approximation works.
· SVD is applied to grayscale images and color images.
· Measures of compression effectiveness.
· Case studies demonstrating strengths and shortcomings.
· Comparison with JPEG and a look toward the future.
This tour will be a mixture of math, story and code snippets. At the end, you will appreciate how a process commonly seen in any linear algebra class has a direct positive impact on one of the toughest challenges in the digital age.
Utilizing Singular Value Decomposition in Mathematical Concepts
An image is a matrix. A grayscale image can be seen as an m×n matrix of pixel intensity values. A color image is simply three of these matrices in combinations, specifically one matrix for each of red, green, and blue.
Singular value decomposition is a special type of factorization in linear algebra. For any m×n matrix A:
-U is an m×m orthogonal matrix. Its columns called left singular vectors are a basis of the row space of A.
-V is the transpose of an n×n orthogonal matrix. Its rows called right singular vectors represent a basis of of the column space.
-Σ is an m×n diagonal matrix containing the non-negative singular values σ1≥σ2≥⋯≥0.
The singular values function as an ordering such that the first variable captures the first most important structure- the second variable captures the second most important, etc. So by the time we get to the smallest singular values we are just encoding some small fixed details or noise.
Rank-k Approximation
The true power of SVD is in the approximations we can make. Suppose we only keep the first k singular values, and we drop the rest. We can write this as follows:
Uk and Vk are truncated to the first k columns, and Σk is the top-left k×K block. This matrix Ak is the best possible rank-k approximation of A in the sense that it minimizes the reconstruction error.
What does this mean in practical terms? In practical terms, it allows us to represent an image with far fewer numbers while most of the content is preserved.
Intuition and Analogy
Envision an orchestra powering through a symphony. No one in their right mind is cataloging each note from every single instrument — trumpet, violin, you name it. Totally impractical. Instead, the typical summary would be, “Strings are driving the main melody, percussion’s anchoring the rhythm, woodwinds are layering in harmonic texture.” With that snapshot, you’ve captured the overall framework. There’s no necessity to get mired in every micro-detail; you retain the core structure without excessive data overload.
Now SVD does the same for images. The first singular values capture mostly lighting, gradient backgrounds, and the main edges. Then the next singular values can account for edge details, shading, and texture, etc. So, when we cutoff at some k , we retain the main effects and remove the noise.
Most SVD tutorials start with grayscale images because they’re conceptually simple. But in practice, we use RGB color images, which are three times as complex.
A color image consists of three m×n matrices:
Image=[R,G,B]
Each channel is compressed separately:
R≈Rk, G≈Gk B≈Bk
Then recombining these approximations yields the compressed color image.
The independence of the channels is a double-edged sword: it makes the algorithm straightforward to implement, but it also derides the advantages gained by knowing the correlations between channels — for example, how edges in the red usually coincide with edges in the green and blue channels. More advanced methods try to take advantage of these correlations, but the simple SVD simply treats them independently.
Measuring the Effectiveness of a Compression
Compression requires a trade-off: we want to reduce storage but we don’t want to lose quality. To measure performance, we need some measurements.
Compression Ratio (CR)
Compression ratio is a measurement of space: it compares the storage for the compressed representation with the original.
The size for the original s an m × n RGB image can be seen as:
Original Size = 3mn
With rank-k compression, each channel stores Uk (m×km×k), Σk (k), and V*k *(k×n),
totaling k (m+n+1) k (m+n+1).
Thus:
Compressed Size = 3k (m+n+1)
and:
CR = k (m+n+1) / mn
The smaller CR, the more efficient the compression.
Relative Error
For assesing the accuracy, Frobenius norm has been used:
\text{Relative Error} = \frac{\|A - A_k\|_F}{\|A\|_F}
This metric basically standardizes how well the approximation matches the original matrix. Lower relative error values mean the approximation is closer to the original — so, higher precision.
It is important to mention that relative error does not always match human perception; an error of 0.1 may look acceptable in some images and unacceptable in others. That is why it is always good to do a visual inspection along with the mathematical error metrics.
Case Studies
A. Small Image
For purposes of this section, let’s consider an extremely small 4×4 RGB image.
Original size is: 3×4×4=48 values.
With k=2,k=2, compressed size: 3×2×(4+4+1)=54
3×2×(4+4+1)=54 values.
Storage is higher after compression!
What about significant error?
The relative errors were small (< 2%). Meaning, the reconstructed image looks very similar. But from STORAGE perspective, it is irrelevant.
Lesson learned: SVD is best for large images, not small ones.
B. Large Real Image
We’re also looking at realistic image of size 435 × 375 (~489,375 values).
With k=50, the compressed image size is ~121,650 values.
Compression ratio ~0.249 (25% of the image).
The relative errors are 0.099 ( R ), 0.116 ( G ), and 0.144 ( B ).
Press enter or click to view image in full size
Fig 1: A large image example [10] and the compressed output with k=50.
Visually, the compressed image appeared nearly identical to the original. Subtle blurring became noticeable only upon close inspection or significant zoom, primarily in areas with fine textures. For most typical viewing scenarios, these minor differences would be difficult to detect.
As calculated:
Relative errors:
Red channel — ~0.099
Green channel — ~0.116
Blue channel — ~0.144
The compressed large image visually looked very similar to the original image. However, it was only when zoomed-in that you could notice slight blur in some finer textures.
Lesson learned: SVD reduces image size for large images while will only incur (relatively) small loss in image quality.
Performance Review and Summary
Press enter or click to view image in full size
TABLE I: Performance Comparison of SVD Compression on Small and Large Images
TABLE I captures the results. The above examples provide evidence that SVD effectively compresses color images by approximating each of the RGB channels as the sum of low-rank matrices with minimal information loss. For larger images, especially with a low compression ratio and relative error(s), SVD compression could provide great advantages; however, for compression of small images, the extra storage cost for the decomposition matrices could add size and vision loss to the image.
Systemic Experiments
To further assess the effectiveness of SVD-based color image compression, we conducted a set of computer experiments using a high-resolution RGB image. Each color channel of the image was compressed separately with various numbers of singular values p ∈{5,10,20,30,40,50,75,100,}. For each value of p we recorded the compressed storage size, compression ratio, and relative error.
Press enter or click to view image in full size
TABLE II: Compression Analysis with Varying Numbers of Singular Values p
A. Result Analysis
As observed in TABLE II and Fig 2, we can see that the number of singular values increases reconstruction quality and storage, almost like a rollercoaster, at least in the context of this application provided above. With only p= 5 singular values, we have an extraordinary low compression ratio of 0.0057 and a high relative error of 0.1526.
From table II, K=5: Error of about 0.15 — the image is heavily distorted.
K=20: Error of about 0.115 — there are a lot of gains in data recovery
K=50: Error of about 0.092 — the image is visually almost perfect
K=100: Error of about 0.071 — the image is nearly indistinguishable but it requires double the data to store it compared to K=50.
This shows SVD compression can still do well on very large images especially when there is an acceptable level of compression and error required well established.
B. Visualizing the Trade-Off
Imagine three figures that illustrate:
**Relative Error versus Number of Singular Values: **a steep drop, which flattens at the level of k=50.
Compression ratio versus Number of Singular Values: a steadily rising line, demonstrating that if you desire quality, you will have to sacrifice compression savings.
Press enter or click to view image in full size
Fig 2 : Relative Error and Compression Ratio vs. Number of Singular Values
Press enter or click to view image in full size
Fig 3: The singular values for red, green and blue channels
Image Grid: side-by-side reconstructions with k=5, k=20, k=50, and k=100. When k=5 it looks somewhat abstracted as faces; at k=20 people can be defined as shapes; at k=50 the image looks natural; and at k=100 we cannot distinguish between the actual image and the reconstruction.
Press enter or click to view image in full size
Fig 4: Compressed figures with different singular values (consent given for using my image for the project)
These visuals really help to make the trade-off apparent; small values of k result in compression, while large values of k result in quality.
Strengths and Weaknesses
Strengths:
-
Mathematically elegant
-
Tunable — we can choose a k we feel is a good trade-off
-
Works very well for larger repetitive images
Weaknesses:
-
Computationally heavy — an SVD on a large matrix can take a considerable amount of time to calculate
-
Performing less well with any smaller image
-
Can’t control all of the color channels as one (and possibly missing correlations across color channels)
-
Generally SVD methods are more tunable than JPEG methods (for the same set of images and error), but SVD methods are typically not as efficient. JPEG is designed to be efficient (and to human visual perception), while SVD is designed to be general and educational, and necessarily has a higher burden of computation.
Conclusion
Great algorithms tend to be simple. Singular Value Decomposition is one of the isolated ideas in linear algebra: dig into a matrix, separate its essential parts, hold onto what’s meaningful, and ignore the rest.
When we apply SVD to an image, we get tremendous compression. By only holding onto a few singular values, we are able to store images at a much smaller file size and with little difference in appearance.
Does this mean SVD is going to be replacing JPEG tomorrow? Not likely. JPEG has the advantage of speed, has better optimization, not to mention it is entrenched and the worldwide standard. However, as a pedagogical tool, as a research tool, and as a reminder of the power of mathematics, SVD has much to offer.
In an era of Big Data, SVD teaches us all: sometimes less really is more.
Reference:
[1] L. P. Garcia, G. Furano, M. Ghiglione, V. Zancan, E. Imbembo, C. Ilioudis, C. Clemente, and P. Trucco, “Advancements in on-board processing of synthetic aperture radar (sar) data: enhancing efficiency and real-time capabilities,” IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2024.
[2] A. Jamshed, P. S. Mehra, D. Samanta, T. Gupta, and B. Bhardwaj, “Introduction to digital imaging,” in Computer-Assisted Analysis for Digital Medicinal Imagery. IGI Global, 2025, pp. 1–28.
[3] A. J. Hussain, A. Al-Fayadh, and N. Radi, “Image compression techniques: A survey in lossless and lossy algorithms,” Neurocomputing, vol. 300, pp. 44–69, 2018.
[4] H.-Y. Shum, S. B. Kang, and S.-C. Chan, “Survey of image-based representations and compression techniques,” IEEE transactions on circuits and systems for video technology, vol. 13, no. 11, pp. 1020–1037, 2003.
[5] G. Sonmez, C. K. Shen, Y. Rubin, and F. Wudl, “A red, green, and blue (rgb) polymeric electrochromic device (pecd): the dawning of the pecd era,” Angewandte Chemie, vol. 116, no. 12, pp. 1524–1528, 2004.
[6] N. K. More and S. Dubey, “Jpeg picture compression using discrete cosine transform,” International Journal of Science and Research (IJSR), vol. 2, no. 1, pp. 134–138, 2013.
[7] S. A. Khayam, “The discrete cosine transform (dct): theory and application,” Michigan State University, vol. 114, no. 1, p. 31, 2003.
[8] A. P. Singh and G. J. Gordon, “A unified view of matrix factorization models,” in Joint European Conference on Machine Learning and Knowledge Discovery in Databases. Springer, 2008, pp. 358–373.
[9] H. Abdi, “Singular value decomposition (svd) and generalized singular value decomposition,” Encyclopedia of measurement and statistics, vol. 907, no. 912, p. 44, 2007.
[10] Wikipedia contributors, “LeBron James — Wikipedia, The Free Encyclopedia,” https://en.wikipedia.org/wiki/LeBron James, 2025, [Online; accessed 7-April-2025]. [Online]. Available: https://en.wikipedia.org/wiki/LeBron James