can be a compression rate 100%,200%----1000% also send me a equation to calculate compression rate.

13 views (last 30 days)
Sam on 7 Mar 2016
Answered: Walter Roberson on 7 Mar 2016
can be a compression rate 100%,200%----1000% also send me a equation to calculate compression rate.
Geoff Hayes
Geoff Hayes on 7 Mar 2016
Sam - please clarify what you are looking for. Do you want an algorithm to compress an image? Is this part of your homework?
You will more likely receive help if you provide details on the purpose of your code, show what you have attempted, and discuss any errors or problems that you have encountered.

Sign in to comment.

Answers (2)

Moe_2015 on 7 Mar 2016
Do you mean compression ratio? Because with a simple search it looks like the equation is easy to use. Also if you are asking can a compression ratio be 100%, 200%, up until 1000% the answer is yes.

Sign in to comment.

Walter Roberson
Walter Roberson on 7 Mar 2016
There are two different measures in common use: compression rate, and compression ratio. When you see something expressed as a percentage, then it is always a compression rate, not a compression ratio. Compression rates cannot exceed 100. Compression ratios can exceed 100, but are never stated as percentage.
Compression rate:
(1 - (size of compressed version) / (size of original)) * 100
For example, a 66.6% compression ratio would indicate that 2/3 of the storage space has been saved and that 1/3 of the original space is still required. A 1000% compression ratio would indicate that the data has been compressed down to negative nine times its original size, which is of course impossible (at most you could compress down to zero times the original size, 100% compression.)
Compression ratio is always given in ratio form, never in percentage form.
Compression rate:
(size of original) : (size of compressed version)
reduced down to some "pleasing" rational, typically in "something to 1" form. For example, no-one ever quotes 31917 : 8352 as a compression ratio, but they might quote 375 : 1
If that hypothetical 31917 original were to be compressed down to size 1, that would be a ratio of 31917 : 1, so in ratio form it is possible to exceed 100 or 1000.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by