Saturday, June 21, 2008

Photomosaic Mickey Mouse

Step 1:
After reviewing many, many images, I have decided to use the Mickey Mouse image. This image provided a lot of contrast which I believe will define the colours more easily.
The size of the original image is 425, 300, 3.


Step 2:
I reduced the image by a factor of 0.1 using the nearest neighbour method. After speaking to my buddy, Saajida, and reviewing the dicussion board in facebook, I decided to save all my images with a '.png' extensions.
The reduced size of this image is 42,30,3.



Step 3:

I enlarged my shrunken image in step 2 by double the original size.
The enlarged image size is 840, 600,3.


Step 4:

I have reduced my image to 27 colours using the following command: B=floor(double(A)/86)*86+42;

My image surprised me. The original white background displays a grey tone when I reduced the colours. Furthermore, there were not many significant colour change. The reduced colour looks very similar to the original colours.



Since there didn't seem a huge change in the colour tones I reduced the colour of my original sized image. As you can see there is not a lot of change. I believe this occurred because my image displays more of the primary colours.



Original image reduced to 27 colours



Step 5:



Here are the 27 possible colours. They are in reverse starting with colour(214,214,214....42,42,42). I was fooling around with the various colours and although the colours are not displayed in a nice template form, I thought it would be foolish to redo the colours since the colours are visible. Now the fun begins....

Step 6:

Collecting images.....
I originally had different Walt Disney characters, but with varying image sizes and skewing the rows and columns didn't help. So I decided after days of work, I would try using one image in 27 different colours.

Step 7
Replacing the small images into the large image. Well, not what I expected. I'm not too sure why the image turned out the way it did. I have been on the computer for 14 hours and I have tried to resolve the problem,. I have even tried to replace the large image of Mickey with different images. I still get straight lines throught my image. My other thought was that perhaps there is something in the image that I could not see and in fact the pixels are being replaced properly. Either way after all that work, I was very disappointed with the results. I am going to try another one. Octave commands for this image are listed below.

OCTAVE COMMANDS USED

cd c:\users\tim\pictures
M((,:,1)=ones(10);M(:,:,2)=ones(10);M(:,:,3)=ones(10);

M1=imread("lion2(42,42,42).png");M11=floor(double(M1)/86)*86+42;M2=imread("lion2(42,42,214).png");M12=floor(double(M2)/86)*86+42;M3=imread("lion2(128,42,42).png");M13=floor(double(M3)/86)*86+42;M4=imread("lion2(214,42,42).png");M14=floor(double(M4)/86)*86+42;M5=imread("lion2(214,128,42).png");M15=floor(double(M5)/86)*86+42;M6=imread("lion2(214,214,42).png");M16=floor(double(M6)/86)*86+42;M7=imread("teresa.png");

M8=[M11,M,M12,M,M,M,M,M,M,M13,M,M,M,M,M,M,M,M,M14,M,M,M15,M,M,M16,M,M7];
M41(:,:,1)=42;M41(:,:,2)=42;M41(:,:,3)=42

M42(:,:,1)=42;M42(:,:,2)=42;M42(:,:,3)=128;

M43(:,:,1)=42;M43(:,:,2)=42;M43(:,:,3)=214;

M44(:,:,1)=42;M44(:,:,2)=128;M44(:,:,3)=42;

M45(:,:,1)=42;M45(:,:,2)=128;M45(:,:,3)=128;

M46(:,:,1)=42;M46(:,:,2)=128;M46(:,:,3)=214;

M47(:,:,1)=42;M47(:,:,2)=214;M47(:,:,3)=42;

M48(:,:,1)=42;M48(:,:,2)=214;M48(:,:,3)=128;

M49(:,:,1)=42;M49(:,:,2)=214;M49(:,:,3)=214;

M50(:,:,1)=128;M50(:,:,2)=42;M50(:,:,3)=42;

M51(:,:,1)=128;M51(:,:,2)=42;M51(:,:,3)=128;

M52(:,:,1)=128;M52(:,:,2)=42;M52(:,:,3)=214;

M53(:,:,1)=128;M53(:,:,2)=128;M53(:,:,3)=42;

M54(:,:,1)=128;M54(:,:,2)=128;M54(:,:,3)=128;

M55(:,:,1)=128;M55(:,:,2)=128;M55(:,:,3)=214;

M56(:,:,1)=128;M56(:,:,2)=214;M56(:,:,3)=42;

M57(:,:,1)=128;M57(:,:,2)=214;M57(:,:,3)=128;

M58(:,:,1)=128;M58(:,:,2)=214;M58(:,:,3)=214;

M59(:,:,1)=214;M59(:,:,2)=42;M59(:,:,3)=42;

M60(:,:,1)=214;M60(:,:,2)=42;M60(:,:,3)=128;

M61(:,:,1)=214;M61(:,:,2)=42;M61(:,:,3)=214;

M62(:,:,1)=214;M62(:,:,2)=128;M62(:,:,3)=42;

M63(:,:,1)=214;M63(:,:,2)=128;M63(:,:,3)=128;
M64(:,:,1)=214;M64(:,:,2)=128;M64(:,:,3)=214;
M65(:,:,1)=214;M65(:,:,2)=214;M65(:,:,3)=42;
M66(:,:,1)=214;M66(:,:,2)=214;M66(:,:,3)=128;

M67(:,:,1)=214;M67(:,:,2)=214;M67(:,:,3)=214;

M9=[M41,M42,M43,M44,M45,M46,M47,M48,M49,M50,M51,M52,M53,M54,M55,M56,M57,M58,M59,M60,M61,M62,M63,M64,M65,M66,M67];

M10=imread("mic3.png");
s=10;

for i=1:10:840;

for j=1:10:600;

for m=1:27;

if M10(i,j,:)==M9(1,m,:);

M10(i:i+s-1,j:j+s-1,:)=M8(1:10,(m-1)*s+1:m*s,:);

end; end; end; end;

imshow(double(M10)/255);

Well, I thought I would try my original image (strawberries and kiwis). I also decided to struggle through resizing different images to replace into my fruit image. Well, sad to say, I ran into another brick wall. I hoping to resolve this problem very soon also!

No comments: