clear;
s = 'baboon.png';
fig = imread(s);

yq = compress(fig,1,'std');
figure(1); print('problem5_orig','-dpng');
figure(2); print('problem5_p1','-dpng'); dlmwrite('problem5_p1',yq);

yq = compress(fig,2,'std');
figure(2); print('problem5_p2','-dpng'); dlmwrite('problem5_p2',yq);

yq = compress(fig,4,'std');
figure(2); print('problem5_p4','-dpng'); dlmwrite('problem5_p4',yq);