MATLAB: Filesize of an image

digital image processingfilesizeimageImage Processing ToolboxMATLAB

i gone through some doc where i know the formula for an image filesize that is filesize = (height*width*bitdepth)/8 ;
i read an image file with imfinfo command it gives Filename: [1×50 char] FileModDate: '21-Nov-2013 18:42:02' FileSize: 174421 Format: 'jpg' FormatVersion: '' Width: 728 Height: 485 BitDepth: 24 ColorType: 'truecolor' FormatSignature: '' NumberOfSamples: 3 CodingMethod: 'Huffman' CodingProcess: 'Sequential' Comment: {}
so according to this file size is 174421 but according to formula its coming (728*485*24)/8 = 1059240
so what is the file size acualy is of an image

Best Answer

Your image is stored as a jpg-file, which usually means that the image is compressed. In this case using the Huffman method (CodingMethod) (for more info see http://en.wikipedia.org/wiki/Huffman_coding ).
Compressing an image results in a smaller file than you would expect based on the size on the image. This is useful to save space on a hard drive.
When you open the file it will be decompressed and usually it will be stored uncompressed in your memory (RAM). Then it will occupy 1059240 bytes.