Image::ExifTool will read the headers of most images and tell you what size the image is, its width, height, and bits per pixel. It'll even give you extra headers if you want (like camera model and make, settings, etc). | [reply] |
How can I calculate the image size in kb/b?
Essentially, you don't. It will vary widely dependant upon the image format (.gif, .png, .jpg etc.), the compression mode (quallity mode for .jpg), and the image itself. An image consisting of all one color, or just 2 or 3 colors will compress much better than a complex image containing lots of colors,
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
height * width * color_depth_in_bytes / 1024
| [reply] |
If the image is stored locally, you could use -s. If the image is accessible by web server, you could do a HEAD request and check for a Content-Length header.
| [reply] [d/l] [select] |