image=imread('img2007-1-17-91030.jpg');
image=im2double(image); 
image=rgb2gray(image);
subplot(2,3,1);
imshow(image)
title(['Original Image']); 
[ new T error ] = compress1( image );
subplot(2,3,2);
imshow(new);
title(['Compressed ( T = ', int2str(T), '  Error = ', num2str(error), ' )']); 


[ new T error ] = compress2( image, T );
subplot(2,3,3);
imshow(new);
title(['Advanced Compressed ( T = ', int2str(T), '  Error = ', num2str(error), ' )']); 

image=imread('img2007-1-17-91110.jpg');
image=im2double(image); 
image=rgb2gray(image);
subplot(2,3,4);
imshow(image)
title(['Original Image']); 
[ new T error ] = compress1( image );
subplot(2,3,5);
imshow(new);
title(['Compressed ( T = ', int2str(T), '  Error = ', num2str(error), ' )']); 


[ new T error ] = compress2( image, T );
subplot(2,3,6);
imshow(new);
title(['Advanced Compressed ( T = ', int2str(T), '  Error = ', num2str(error), ' )']); 
