Time to be with your loved ones

Time to be with loved ones

by sat

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

I'd like to be able to determine the size of a an image with a particular resolution/ppi for JPEG & PNG formats.

Are there any online tools to do this?

share|improve this question
    
To clarify, do you mean file size or dimensions? –  ElendilTheTall Jul 1 '11 at 9:18
    
file size, thanks. –  Bravax Jul 1 '11 at 9:44
1  
Sorry, just to make this completely clear, but: file size in megabytes on disk, from just the parameters you've listed? Because the program suggested in the answer you've marked as accepted doesn't actually do what you're asking — it's just showing the actual size of a given file, which of course you can get from any file manager. –  mattdm Jul 1 '11 at 13:12
add comment

2 Answers

up vote 3 down vote accepted

If I get you right, you want to predict an images (JPEG and PNG) file size before your take the picture.

In short: I do not think that this is doable, without actually taking the picture. Here's why:

PPI: First DPI / PPI does not apply to a digitally stored image. Take an arbitrary image change the dpi without recalculation of the image so the pixels in length and width are equal and produce a 7, 72, 96, 960 dpi jpeg version. All will have the same file size (and also be displayed the same size at 100%). PPI information is only used when printed, for example.

Resolution: Yes, the resolution (y-pixel - x-pixel) of the sensor can be taken into calculation precisely.

JPEG / PNG - Type: Both of these formats (types) will compress the data the sensor provides by using compression algorithms. Hence the compression rate, that finally will define the file size, depends on the data which you only know if you take the picture.

If you would take the color depth (bits per pixel) into account and shoot in uncompressed RAW, a forecast of the files size could be calculated I guess. However, since the RAW file will contain all meta data (camera settings and so on) too, you'll end up with an estimation again.

share|improve this answer
2  
Good answer, el_migu_el. I'll just add that of all the compression tricks (and there are a few in jpeg), the one that prohibits the prediction of the size is the lossless compression. The compression ratio of the lossy compression phase is determined by the quality parameter. –  ysap Jul 1 '11 at 13:13
    
@ysap: did you mean lossy when you say lossless there? (Both will result in hard-to-predict final sizes, but I'm unclear on how to read what you're saying. Hmmmm. That's going on a lot this morning — maybe it's me, and I just haven't had enough coffee.....) –  mattdm Jul 1 '11 at 14:36
    
@mattdm - as of lossless, I think that it is clear why it is hard to predict (if not, let me know). As of the lossy part - the reduction in size is predetermined by the decimation and quantization of the DCT coefficients in the macroblocks. The amount is determined by the quality parameter and it is up to the implementation to decide how much to lose. –  ysap Jul 1 '11 at 14:39
    
For those unfamiliar with the details of JPEG: this compression consists of two phases. The first one includes conversion of macroblocks (8x8 pixels) to freq. domain via DCT. Then, the high frequency components are being discarded or quantized to lower bit width. This is the lossy part and is pre-determined. The second phase includes reordering of the DCT coefficients, RLE compression and Enthropy coding (Huffman) compression. This is lossless compression, but the ratio is unknown until the end of the process. –  ysap Jul 1 '11 at 14:53
    
Oh, okay, I got it now. It was the coffee. :) –  mattdm Jul 1 '11 at 15:06
show 1 more comment

if you want to get the printed image size based on the resolution, then it is possible to do it simply in free IrfanView image browser, where you can calculate the printed size based on the DPI.

Irfanview picture size-dpi

share|improve this answer
1  
But you don't really need a special tool to do division.... –  mattdm Jul 1 '11 at 13:02
    
@mattdm - that's below the belt... :O –  ysap Jul 1 '11 at 13:14
    
mattdm, OK, but it very useful to have such feature directly in browser, as math never was my favorite subject. –  Juhele Jul 1 '11 at 13:18
    
Well, beyond that, the value given is computed from the meaningless DPI value, which really is not very useful. –  mattdm Jul 1 '11 at 13:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.