is compression used to reduce the file size?
Show older comments
please can someone explain me what is compression... is it means reducing size of an image.... i got a code for image compression.... but my input image size is 256*256 and the compressed image size is also 256*256.... i'm totally confused... i read few topics related to compression.... but i'm not clear about that.... please can someone spare few time to explain me....
Accepted Answer
More Answers (2)
Walter Roberson
on 25 Apr 2014
2 votes
Several students lately have been working with DCT or DWT, arriving at a matrix of coefficients that is the same size as the original, and then asking what the compression ratio is.
DCT and DWT themselves do not compress. What they do is find a way to describe images so that the last coefficients are describing finer and finer detail that a human would often overlook. If you keep only the beginning coefficients and discard the ending coefficients for a block, you have kept most of the information about how the block looks, and since you are not keeping all of the information you do not need as much space to store what you kept. Then when it is time to rebuild, the coefficients that were discarded are filled in with 0 and the block is rebuilt from that matrix, an action which produces an output block that differs only slightly from the original image block. The fewer coefficients you discarded, the more accurate the reconstruction but the lower the compression ratio. The more coefficients you discard, the less accurate the reconstruction but the higher the compression ratio.
1 Comment
Elysi Cochin
on 26 Apr 2014
Image Analyst
on 25 Apr 2014
1 vote
You need to look at how many bytes are used to store the 256*256 pixels on disk . When you read it back in , it will undo any compression what was applied and you will end up back with the same resolution that you started with , though perhaps with some intensity changes depending on how lossy the compression was.
Categories
Find more on Denoising and Compression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!