1. does doing dct followed by quantization and idct decompress the image?
  2. does run length encoding(rle) help to compress?
  3. when we save a file as jpeg and open it does it perform both dct and idct or only dct?
  4. how can i check if my image is compressed since both the original and output image are 256x256?
  5. in order to write a program to perform jpeg compression and display the compressed image do i have to use zig zag scanning and rle?

 채택된 답변

Walter Roberson
Walter Roberson 2014년 2월 8일

0 개 추천

1. No.
2. Often enough to be useful, but not always.
3. You have not specified what "it" is.
4. In that situation there is no compression.
5. No. If you use lossless jpeg then the algorithm does not use those steps.
Compression involves processing data and creating an output that takes less storage than the original data. Decompression involves taking that lower-storage version and expanding it back to something (close to) the original data. The step you have missed in several of your questions is the "creating an output that takes less storage than the original data". Calculating dct and quantizing it probably does not take less storage -- but you can then take the quantized data and output only parts of it. The less you output the more the compression but the less accurately you can reconstruct the original data.

댓글 수: 13

Image Analyst
Image Analyst 2014년 2월 8일
Regarding 4, you can use dir() to check the file size on disk and see if it's less than the uncompressed version. Of course when it's read back in and decompressed it will be the same size.
jithin
jithin 2014년 2월 9일
@ Walter Roberson:"but you can then take the quantized data and output only parts of it". hw do i do tht? hw is tht acomplished in jpeg?
jithin
jithin 2014년 2월 9일
"3.when we save a file as jpeg and open it does it perform both dct and idct or only dct?" it refers to the file saved as jpeg.
Walter Roberson
Walter Roberson 2014년 2월 9일
My understanding is that in JPEG, the major DCT coefficients occur first, and that as one goes on, additional DCT components add finer and finer detail. If one only outputs a limited number of DCT coefficients rather then the whole set, then one will be unable to recreate the fine detail, but less storage will be taken. On decompression, the missing DCT coefficients are filled in with zeroes. The processing method is such that humans usually have difficulty detecting the missing detail; however, sharp vertical lines such as for text often suffers visibly before other aspects would be noticeable. Humans are good at detecting problems with sharp vertical lines.
3. Compressing an image in JPEG lossy mode and saving it (e.g. to a file) involves dct but not idct. Decompressing a JPEG image (e.g. from a file) involves idct but not dct.
jithin
jithin 2014년 2월 10일
so wil an image be compressed if i take its dct quantize it, and then take its idct ?
Walter Roberson
Walter Roberson 2014년 2월 10일
No. The compression would not occur unless you discarded parts of the result of the dct. And even if you did that, filling in those missing components with 0 and taking the idct would result in something that was the original size, a slightly blurred version of the original.
jithin
jithin 2014년 2월 13일
how do i discard the missing components after quantization with zeroes? could u please provide me the code for the same(to remove zeroes)?
Walter Roberson
Walter Roberson 2014년 2월 13일
In real JPEG files, you would write the component values that you wanted to keep, followed by an End Of Block marker. As the total number of components per block is constant, the decompression knows how many zeros need to be filled in.
My recollection is that the component values are written out in a modified Huffman encoding; in that case, the End Of Block marker would be a symbol in the table that the software knew indicated something special instead of a numeric component value.
jithin
jithin 2014년 2월 17일
sorry i could |you please explain how do encode it...how to place and detect EOB using matlab.. |
Walter Roberson
Walter Roberson 2014년 2월 17일
Are you familiar with huffman encoding?
jithin
jithin 2014년 2월 17일
not actually..How do i encode dct transformed , quantized and zigzag scanned coefficients using matlab?
jithin
jithin 2014년 3월 2일
i have done rle and used NaN to represent EOB. how can i do arithmetic encoding on the rle encoded sequence
jithin
jithin 2014년 3월 2일
i'd prefer to use the built in function for arithmetic encoding but i cant understand what the arguments must be. my input is rle encoded sequence.also how can i show that an image which is dct transformed, quantized, rle encoded ,arithmetic encoded sequence occupies less bandwidth as compared to the original image

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

추가 답변 (1개)

jithin
jithin 2014년 2월 17일

0 개 추천

i am working on Image Compression Using Intra prediction of H.264 using matlab.. 1.Is compression using intra prediction better than that(compression) using jpeg? 2.How can we prove that compression using H.264 is better than jpeg compression? 3.Could you please provide me the code for run length encoding?

댓글 수: 3

Walter Roberson
Walter Roberson 2014년 2월 17일
H.264 is for motion. JPEG is for static images.
jithin
jithin 2014년 2월 17일
i meant comparison between intraprediction and jpeg.. How can i prove that intraprediction produces better compression?
Deepak Mishra
Deepak Mishra 2022년 9월 8일
i meant comparison between intraprediction and jpeg.. How can i prove that intraprediction produces better compression? and how can analysis filter cutoff frequency

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

질문:

2014년 2월 8일

댓글:

2022년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by