function main
home;colormap(gray(256));

for i=1:3
    if i==1, name='broccoli_fractal.png';end;
    if i==2, name='fractal.png';end;
    if i==3, name='lenna.png';end;
    A=double(imread(name));
    
    [nf nc]=size(A)
    vector1=reshape(A,1,nf*nc);
    vector2=comprime(vector1);
    size(vector2)
    
    vector3=descomprime(vector2);
    B=reshape(vector3,nf,nc);   
    %ojo categoria 1: sum(sum(abs(A-B)))==0
    %ojo categoria 2: PSNR(A,B)>20!!!!    
    image(A);
    pause(2);        
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function out=comprime(in)

%%aqui su codigo

out=in;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function out=descomprime(in)

%%aqui su codigo

out=in;


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function db=PSNR(A,B)

[nf nc]=size(A);
media=sum(sum(A))/(nf*nc);
E=sum(sum((A-media).^2));
ERR=sum(sum((A-B).^2));
SNR=E/ERR;
db=10*log10(SNR);

