Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

UltimaX

Compression Ratio Calculating (Is This Right?)

This topic is 5220 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve been working on upgrading my resource creator for my new project and I was wondering if I''m calculating the ratio right? So far I''m using: Result = OriginalSize / CompressedSize Is it really as sinple as that? I''m not good with precentages so I can''t be sure. It seems as though the percentages should be a lot higher? Here''s how the percentages are coming out: 3072 / 320 = 9.6% Right? Thanks for the help. -UltimaX- Ariel Productions "You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites
Advertisement
Your 6th value down goes from 768 KB to 319 KB and you have a 2% ratio. But 319KB / 768 KB is 41%. So there is definitly something wrong with your percentages.

LinaInverse2010

Share this post


Link to post
Share on other sites
quote:
Original post by LinaInverse2010
Your 6th value down goes from 768 KB to 319 KB and you have a 2% ratio. But 319KB / 768 KB is 41%. So there is definitly something wrong with your percentages.

LinaInverse2010


So do I have it backwards?
Instead of:
Result = OriginalSize / CompressedSize

Do I need:
Result = (CompressedSize / OriginalSize) * 100

Thanks

-UltimaX-
Ariel Productions

"You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites
Yup, that should do the trick

---------
Life is like a grapefruit. It''s sort of orangy-yellow and dimpled on the outside, wet and squidgy in the middle. It''s got pips inside, too. Oh, and some people have half a one for breakfast

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Still wrong. Should be:

Compression % = (original size / compressed size) * 100

Thus, from your original screenshot:


3.0 MB -> 341.75 KB = 89.9% compression (90%)

Also, make sure you''re working in the same units (bytes). So, 3.0MB = 3.0 * 1024 * 1024 = 3145728 bytes, etc.

That oughtta do it!

Cheers!
Drew

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Still wrong. Should be:

Compression % = (original size / compressed size) * 100

Thus, from your original screenshot:


3.0 MB -> 341.75 KB = 89.9% compression (90%)

Also, make sure you''re working in the same units (bytes). So, 3.0MB = 3.0 * 1024 * 1024 = 3145728 bytes, etc.

That oughtta do it!

Cheers!
Drew


Thanks AP. I calculate them in the same units, it''s just when I display them that I change to the 3.0MB.

Thanks agian,

-UltimaX-
Ariel Productions

"You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites
AP, it come out wrong that way...
When I do it that way I get this:
(384.05KB / 40.85KB) * 100 = 940%

-UltimaX-
Ariel Productions

"You wished for a white christmas... Now go shovel your wishes!"

Share this post


Link to post
Share on other sites
quote:
Original post by UltimaX
AP, it come out wrong that way...
When I do it that way I get this:
(384.05KB / 40.85KB) * 100 = 940%

-UltimaX-
Ariel Productions

"You wished for a white christmas... Now go shovel your wishes!"


Thats right. It is nearly 10 times smaller.



"C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!"

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!