필터 지우기
필터 지우기

Filesize of an image

조회 수: 2 (최근 30일)
chitresh
chitresh 2013년 11월 22일
댓글: Laurent 2013년 11월 22일
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: [1x50 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

채택된 답변

Laurent
Laurent 2013년 11월 22일
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.
  댓글 수: 2
chitresh
chitresh 2013년 11월 22일
so this means it gets some compression ratio and the compression ratio formula is C.R = original size / compressed size so it compression ratio is 1059240/174421 is this correct
Laurent
Laurent 2013년 11월 22일
Yes, so approximately 6:1.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by