File Exchange

image thumbnail

Image compression based on DCT

version 1.0 (41.9 KB) by

compdct,decompdct,compdct,resize,proba,zigzag,zigzaginv zigzag16,zigzag32,rle,abais

25 Downloads

Updated

View License

compdct.m:
main code to compress an image we only run compdct.m
decompdct.m:
to decompress an image we only run compdct.m
resize.m:
proba.m:
zigzag.m:
zigzag scan for bloc [8 8]
zigzaginv.m:
inverse zigzag scan for bloc [8 8]
zigzag16.m:
zigzag scan for bloc [16 16]
zigzinv16.m:
inverse zigzag scan for bloc [16 16]
zigzag32.m:
zigzag scan for bloc [32 32]
zigzinv32.m:
inverse zigzag scan for bloc [32 32]
rle.m:
Run length encoding
irle.m:
Inverse Run length encoding
abais.m:
reduce value big than 255

Comments and Ratings (17)

 Undefined function or variable 'XZzag'.

Error in ==> compdct at 114
[M1 M2]=size(XZzag);
 

M'sila Team

Hi, marwa mahmoud
thank you for your interesting to my code, you should only take q=8, th is threshold value give it the value that you want it and you will see the difference.

marwa mahmoud

what value should i enter for th and q

M'sila Team

sabila nur, Thank u for your interest
those instructions :
f=fopen('fichier.dct','w');
 fwrite(f,fichier,'ubit8');
 fclose(f);

 Here I save the image in file "fichier.dct". So no thing passed, and for TC and G u can add any others like MSSIM ....

sabila nur

Hi! Why the step "Save a compressed image in file (*.dct)" is passed?
The end of program only show the value of TC and GC but there is no command to save the image in .dct file

M'sila Team

Hi, Dines kumar
Thank you for interesting
q must be 8
and th "threshold" you can take any + value from 0 to +infinity

Dines kumar

what value should i enter for th and q

amouna hmd

amouna hmd

hi!
I have a question, please help me:
during compression (comptdct.m), what is the value of TH or "seuil" that I must define and why?

shravan

is this only for gray scale images?

en-ahmed aziz

goood

rafik

rafik (view profile)

thank you very much

M'sila Team

Hi min min,
Thank you.

Mr Smart

M'sila Team

Hi shuaibur,
Thank you for your rating.

shuaibur

M'sila Team

We use in this code of compression/decompression:
Reading image-->DCT transformation-->Thresholding-->Quantization-->RLE encoding--> Huffman encoding-->Save a compressed image in file (*.dct)
in decompression steps we should open file(*.dct) and fell these steps: Huffman decoding-->RLE decoding--> Quantization inverse-->IDCT transformation-->Open image as Bmp image

MATLAB Release
MATLAB 7.6 (R2008a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video