Scaling compression2

Post on 04-Dec-2014

251 views 0 download

description

 

transcript

Entropy Scaling image compression

8-bit image

7-bit image

6-bit image

5-bit image

4-bit image

3-bit image

2-bit image

8-bit image 2-bit image

xx=imread('C:\Users\shuman\Desktop\Boat.png');[l,w]=size(xx)for i=1:l for j=1:w zz=dec2bin(xx(i,j),8);yy=zz(5:8);ff(i,j)=16*bin2dec(yy);

hh2(i,j)=64*round(xx(i,j)/64);hh3(i,j)=32*round(xx(i,j)/32);hh4(i,j)=16*round(xx(i,j)/16);hh5(i,j)=8*round(xx(i,j)/8);hh6(i,j)=4*round(xx(i,j)/4);hh7(i,j)=2*round(xx(i,j)/2); endendfigure,imshow(xx)figure,imshow(ff)figure,imshow(hh2)figure,imshow(hh3)figure,imshow(hh4)figure,imshow(hh5)figure,imshow(hh6)figure,imshow(hh7)

THANK YOU