Sign up

Widgets » Web Developer » image size

  • 33 downloads last 7 days
  • 5,025 total downloads
  • Rating: +2 (login to vote)
image size V1.0 Mar 1, 2007 5:38:23 PM

Calculate the size of an image, depending on its dimensions, compression and color depth.


Comments 3 posts

Log in at the top of the page to post a comment.

1 - 3 of 3

Oops, my previous comment seems to have gotten cut off, probably because of a limit on the post length. It was supposed to end with the words:

"even if you don't see this reply, perhaps it will be helpful to someone.
Just to be clear though, I have no connection to the author."

By Isildur , # Jan 21, 2009 6:32:14 AM

seremina, there's no particular picture in question, because the widget is just be for giving you a ballpark figure of what a hypothetical image's file size would likely be, based on the parameters you enter.

The calculation is Width x Height x compressionRate x (BitDepth/8) x (1/1024) = #KB
("1/1024" because there are 1024 bytes in a kilobyte, "Bitdepth/8" because there are 8 bits to a byte)

For JPEG it assumes a rate of 1/10, for PNG a ratio of1/2, for GIF a ratio of1/3, and plain bitmaps are uncompressed (1/1). You can readjust the compression rate though.

A problem however, is that in reality the filesize of compressed images can vary enormously depending on the complexity of the contents. For example, If you make a PNG image with nothing but some horizontal stripes of various solid colors, you can easily get an extreme compressed:uncompressed ratio, like 1:876 for this picture:
http://img101.imageshack.us/img101/6941/test2yf8.png. Also, compression rates can often be adjusted.

That said, I think this widget still can be useful for certain kinds of pictures.

Hm, now that I look, I see your comment was posted nearly a year ago; even if you don't see this reply, perhaps it w

By Isildur , # Jan 20, 2009 9:26:41 PM

Do you show it the picture in question by a virtual upload and it tells you? The description isn't long enough to fully explain all this widget is for.

By seremina , # Feb 25, 2008 2:19:40 AM

Copyright © 2001 - 2009 Opera Software. All rights reserved. About | Contact | Privacy | Disclaimer |