SVD and image compression for Matlab

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
matqkks
Messages
283
Reaction score
6
Are there any resources which use Matlab to image compress a colour image using SVD? I can only find information where I need to convert to gray scale first.
 
Physics news on Phys.org
Here's what MATLAB says about the conversion:

https://www.mathworks.com/help/matlab/math/image-compression-with-low-rank-svd.html

In their example, they also do the image to grayscale conversion via rgb2gray() after reading in the image. I'm thinking that has to be done because the SVD algorithm won't work with colors which are represented as triplets as in (R,G,B) formulation whereas a grayscale is a single value for each pixel.

According the MATLAB:
the rgb2gray(RGB) converts the truecolor image RGB to the grayscale image I. The rgb2gray function converts RGB images to grayscale by eliminating the hue and saturation information while retaining the luminance. If you have Parallel Computing Toolbox™ installed, rgb2gray can perform this conversion on a GPU.
 
Reply
  • Like
Likes   Reactions: Greg Bernhardt
If you have Image Processing software that can save the colors indiviually to separate files that could be a solution. Merging the compressed color layers back to something usable may not be possible though.