Wednesday, April 1, 2015

Turning a pixel image into a vector image using Adobe Illustrator

If you want to use one of the Fab Lab tools to cut out a picture that is made from pixels (any jpg, png, gif, etc) you'll have to turn it into a vector file first.

I'm going to use this image for the tutorial:
http://commons.wikimedia.org/wiki/File:Smiley_Face.JPG

Step 1: What's a pixel?

Most images that you see on a computer are made from pixels, small rectangles that are different colors. If you look really close at your image you can see them.

The Fab Lab machines don't know how to cut pixels.

Look at the smiley face. Where should the machine cut? On the gray jagged part? Around the yellow part? It's unclear.

We have to convert our image into lines and shapes that the machines can understand. We call this type of file a vector file.

Another benefit of turning our file into vectors is that you can resize the image as big as you want and it won't get blurry or loose resolution. 

Step 2: Choose your image

This step is really important. Some images work better than others. Photographs don't work that well. There is an easy way to edit a photograph to make it work, I'll save that process for another tutorial. This one is for drawings.

You really want to look for high contrast drawings. Drawings with dark areas and light areas, but not too much in between. If you're not sure if it will work, just give it a try.

Generally, bigger images will turn out better. Again, if you're not sure if it will work, just give it a try.

In the case of the smiley face, I have a choice for which size I want, so I'm going to choose the biggest one.

Step 3: Open your image in Adobe Illustrator

Start Adobe Illustrator

At the top menu bar, go to File, Open, and then choose the file you want to open.

Ignore the square behind the face in this tutorial. It's just the canvas drawn by Illustrator and it has no effect on the steps at all. 

Step 4:

Click on the selection tool (the black arrow) in the top of the left tool bar and then click on your image to select it. You know it is selected when there is a blue box around your image. 

Step 5:

Click on the small down arrow button next to Live Trace. See the red arrow in the picture above.

We are going to have Illustrator trace our image and turn it from pixels into lines and shapes; but first we will use the tracing options to do some tricks so that our image cuts better on the Fab Lab machines.


Step 6: Choose Tracing Options...

Click on "Tracing Options..."

Step 7: Turn on Preview

Click on the Preview check box so that we can see a preview of our tracing results every time we make a change to the image. 

Step 8: Move the Tracing Options Box

Click and drag on the top of the Tracing Options box to move it off our image so that we have a better view. 

Step 9: Click Ignore White Check Box

Click the "Ignore White" check box.

This is the trick that we need to do for the Fab Lab machines.

When Illustrator traces all the shapes in this smiley face, it can find the eyes, the mouth, and the circle around the head. But it also sees two more shapes. Can you guess what they are?

Illustrator identifies the white area inside the head as well as the white area around the outside of the head as shapes.

For example, when it does the tracing around the eyes, it will draw an oval around the eye once for the eye and again for the white space around the eye. This is a problem because the machines in the Fab Lab will see both of those overlapping ovals and they will cut around the eye twice!

The easy fix is to make sure we click the Ignore White checkbox when we trace our image. Then Illustrator knows only to draw lines around the dark shapes. 

Step 10: Adjust Threshold Value

If you are happy with the way it looks, go to the next step. If you are not happy yet, then try changing the threshold value.

The Threshold value tells illustrator where we want to trace our lines. All pixels lighter than the Threshold value are converted to white, all pixels darker than the Threshold value are converted to black.

On the black to white color scale, black is 1 and white is 255; any number in between is some shade of gray.

The threshold value can be any number between 1 and 255. For most images, you'll find that the middle (128) is good. But if you don't like the way your image looks in the preview, you can adjust your Threshold value to see if if looks better.

Try 100. Does it look better? Try 200. Does that look better? Adjust the value until you're happy.

If you just can't get it to look right, then your image probably wasn't suitable to start with. Remember it's best to start with high contrast images: images that have dark darks and light lights and not too much in between.

Step 11: Click Trace

Click the blue Trace button to trace the image. 

Step 12: Click Expand

Click the Expand button to finish tracing our entire image. 

Step 13: Open the Color Window

Click on the Color Palette to open the Color Window.

Shapes in Illustrator have a "Fill" and a "Stroke". The fill is the area inside the shape and the stroke is the line around the perimeter, or outside, of our shape.

Right now our shapes have a black fill color and no stroke color. We need to make two changes that so that the stroke color, the line around the outside of the shapes, is black. Also, the fill color should be no fill (clear) or white. This way the Fab Lab machines know to cut around the outside, or the perimeter, of our shapes.

Step 14: Change Fill to Clear

In your Color Window make sure the Black box is on top of the White box with the red slash through it. That means that you can select the fill color.

Just below those boxes click on the white square with the red slash through it. This will make the fill color of all your shapes clear (or no fill). 

Step 15: Change Stroke to Black

We are almost done!

Click on the Stroke Select button hiding under the Fill select button. It's the white and gray square with the red slash going through it.

Then select black for your stroke color. 

Step 16: Save and Finished!

Congratulations you can now change any pixel image into a vector image.

Save your file! You're done!

Ignore the square behind the face in this tutorial. It's just the canvas drawn by Illustrator and it has no effect on the steps at all.

0 comments:

Post a Comment