clear;
s = 'baboon.png';
fig = imread(s);
fig = fig(81:88,81:88,1:3);

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

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

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