Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

function posterizer(originalImage) %posterizes image %max kondrath 2-8-10 %parameters----------test = imread(originalImage); Blankmatrix = size(test); Zeromatrix = zeros(Blankmatrix); Rowtotal = Blankmatrix(1);

Columntotal = Blankmatrix(2); %algorithm %matrix traversal through image to mess with pixels %unable to figure how to get image to be gray in the first place Rowcount = 1; while Rowcount <= Rowtotal Columncount = 1; while Columncount <= Columntotal if test(Rowcount,Columncount) <=100 Zeromatrix(Rowcount,Columncount) = 0; elseif test(Rowcount,Columncount) <= 200 Zeromatrix(Rowcount,Columncount) = 100; else Zeromatrix(Rowcount,Columncount) = 255; end Columncount = Columncount + 1; end Rowcount = Rowcount + 1; end imagesc(Zeromatrix)

You might also like