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

yq = compress(fig,1,'jpegq');
figure(1); print('problem6_orig','-dpng');
figure(2); print('problem6_p1','-dpng'); dlmwrite('problem6_p1',yq);

yq = compress(fig,2,'jpegq');
figure(2); print('problem6_p2','-dpng'); dlmwrite('problem6_p2',yq);

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