Tuesday, June 10, 2008

Assignment #7 -part one

Method #2

Function:( in Matlab, thanks to Violetta)

function[B]=decrease2(A,f)
A=double(A)/255;
p=floor(size(A,1)*f);
q=floor(size(A,2)*f);
for i=1:p
for j=1:q
a= round(i/f); b=round(j/f);
B(i,j,:)=A(a,b,:);
end
end

A=imread('rainbowfb.jpg');
>> image(decrease2(A,.75))

A=imread('rainbowfb.jpg');
image(decrease2(A,.25))

A=imread('rainbowfb.jpg');
image(decrease2(A,.1))

f=0.1
















f=0.75















f=0.25















f=.75

A=imread('bittersweet.jpg');
>> image(decrease2(A,.75))













A=imread('bittersweet.jpg');
image(decrease2(A,.25))














A=imread('bittersweet.jpg');
image(decrease2(A,.1))














And the last image:

A=imread('toyboy.jpg');
image(decrease2(A,.75))
A=imread('toyboy.jpg');
image(decrease2(A,.25))
A=imread('toyboy.jpg');
image(decrease2(A,.1))
f=0.75














f=0.25

















f=0.1

No comments: