Inkscape's auto-tracing capability is very useful for turning existing artwork into SVG drawings. In this example, we will create the artwork for a logo from a photograph. The logo is for the Northern Pacific (or NP) railroad, which features the Yin and Yang symbol. This tutorial will cover use of the Trace Bitmap dialog as well as manipulation of paths. The use of Layers is also introduced.
The steps are:
Start Inkscape and set the drawing size.
Import the source photo.
Auto trace the logo.
Clean up the logo paths.
Procedure 1.4. Creating the Northern Pacific Logo
Set up the drawing.
To begin, start Inkscape.
Follow the instructions for setting the page size and grid spacing given in the Swedish flag example but set drawing size to a width of 500 and a height of 500 pixels. Do not turn on the Grid.
You can use any photograph (in PNG, GIF, or JPEG form) with a logo for this exercise. However, sharp, high resolution photographs work best. I will use part of a photograph from the railroad photographer James M. Fredrickson. The photograph has been cropped to show only the logo. If you wish to use the same photograph as used in the exercise, you can download it from the book's website: http://tavmjong.free.fr/INKSCAPE/.
Import the photograph.
Import the photograph using the → (Ctrl+I) dialog. New in v0.48: A dialog will pop up asking if you wish to embed or link to the image. Since we will not need to keep the image around, it is better to simply link to the file.
Adjust the size and position of the photograph.
Adjust the photograph's size and position to match the Inkscape page with the Select Tool (keyboard shortcut F1). Drag the corners while holding down the Ctrl key to preserve the aspect ratio. Drag the body to translate the photo.
Trace the logo.
Inkscape utilizes the Potrace tracing library to create SVG paths from bitmap images. To trace the picture, call up the Trace Bitmap dialog ( → (Shift+Alt+B)).
The Trace Bitmap dialog presents a number of choices for how the tracing is done. Looking at the image, we see that there are three different grayscale levels. This suggests that we use one of the Multiple scans methods. As this is a monochrome photograph, we'll try the Grays option with Scans set to three. This will give us three regions, each corresponding to one of the grayscale levels. There is the possibility to smooth the bitmap prior to tracing by checking the Smooth box. This is not necessary as our starting photograph doesn't have any speckle. Finally, there is an option to generate paths for mutually exclusive areas or that include all darker regions. The latter is more useful for us, so we check the Stack scans option box. One can get a relatively quick idea of what the final scans will look like by checking the Live Preview box. The resulting traces are shown below.
The paths generated with the Grays option are usable as a starting point for the NP logo. However, we might be able to do better if we use the Single scan, Brightness cutoff method, optimizing the threshold for each scan.
Select the Brightness cutoff option in the Trace Bitmap dialog. Adjust the Threshold to create a well-defined Yin and Yang path. Pressing the Update button will create a preview. A threshold of 0.15 seems to work well. After finding a good value, click on the OK button to generate the path.
The scan has many “blobs” that clutter the picture. We could remove these by hand, but there is an easier way. Select the Options tab in the Trace Bitmap dialog. The Suppress speckles option allows the automatic suppression of paths smaller than the specified size. Make sure the Suppress speckles box is checked and set the Size to 50. While you're at it, make sure the Smooth corners and Optimize paths boxes are checked. This will result in a smooth scan with fewer nodes. Rescan and the “blobs” should be gone.
It will be easier to edit the traces separately. To do so, we'll temporarily move the path. This requires a precise move which can be done with the Transform dialog ( → (Shift+Ctrl+M)). Bring up the dialog and select the Move tab. Move the path a page width to the right by setting the Horizontal entry to 500 pixels, setting the Vertical entry to 0 pixels, selecting the Relative move option, and then clicking on the Apply button. (One could also move the path using the Shift+Arrow keys to move the path 20 pixels at a time. This may be faster than calling up the Transform dialog but there is a small risk of making a mistake in the shifts.)
Next, repeat the trace with a new threshold. This time optimize the threshold for the lettering. A threshold of 0.65 looks good. Execute the trace. The following figure shows what you should see.
Clean up the traces.
Move the photograph to a different layer.
Objects in Inkscape can be selected by clicking on them. This leads to a small problem when using a rubber-band selection technique where one click-drags to select multiple objects as we will want to do a few times. If the click-drag begins over the photograph, the photograph will be moved. One can avoid this by holding the Shift key down while starting the click-drag, but this is a bit of a pain to do every time. One could lock the picture in place by checking the Lock box in the Object Properties dialog but this isn't recommended. It is nontrivial to select and unlock a locked object.
The preferred solution is to put the picture on a separate Layer. Layers can be thought of as separate drawings on transparent sheets that are stacked on top of each other. The final drawing is what one sees through the stack. In Inkscape, the Layers can be easily locked and unlocked against modification. They can also be made invisible. We'll put the photograph on a locked Layer by itself. Then there is no chance of it moving while we work on cleaning up the tracings.
First, create a new Layer for the photograph. This is done through the Add Layer dialog ( → (Shift+Ctrl+N)). Enter the name “Photograph”, select Below current in the Position drop-down menu, and then click on the Add button. The new layer is created below the old layer. It is selected automatically. The layer name is shown in the Status Bar.
Select the photograph by clicking on an opening in the tracing (check the Notification Region to see what is selected). Note that the layer is automatically changed back to the original layer (Layer 1) when the photograph is selected. Move the photograph to the new layer by using the command → (Shift+Page Down). The current layer changes automatically to “Photograph”. Lock this layer by clicking on the icon next to the layer name. The icon should change to the locked state . The photograph now cannot be moved.
Clean up the Yin and Yang.
Select the path for the circles and the Yin and Yang. The current layer will switch to “Layer 1”. Zoom in the paths by hitting the 3 key. Each trace creates one path. Each path is made up of many sub-paths. It is generally easier to clean up a tracing by converting the sub-paths into independent paths. Do this by using the → (Shift+Ctrl+K) command.
The first thing you will notice is that the Yin and Yang symbol becomes all black. Don't panic! This is because the Yin and Yang has been broken into two pieces, one for the outer circle and one for the Yin shape. Each path takes on the attributes of the prior combined path and thus both have black Fill. Select the Yang (left side) path by first clicking on the background to deselect the paths and then clicking inside the area of the Yang path (look at the original photo). You can tell you've selected the correct path by the shape of the bounding box that is shown when the path is selected. If you got the wrong path, try again moving the cursor a bit. It may be necessary to hold down the Alt key while clicking. This will cycle through selecting each object under the cursor in turn. (If the cycling doesn't work, your window manager may be stealing the Alt key. See the section called “Alternative Alt Key” in Chapter 24, Customization, for ways to work around this problem.)
While the photograph is in black and white, the Yang part of the monad in the NP logo should be red. Set the Fill color of the path by clicking on the red square in the Palette (or using the Fill and Stroke dialog).
Next we will replace the complicated path for the outer circle with ... you guessed it, a circle. Select the Ellipse Tool from the Tool Controls. To create a circle, hold down the Ctrl key while click-dragging the mouse from one corner of an imaginary box (the bounding box) that encloses the outer circle, to the opposite corner of the imaginary box. Don't worry about getting the size and position correct at this point.
Turn off the Fill by clicking on the red x at the right end of the Palette. It is easier to adjust the circle if the circle Stroke is a different color than the original and is semi-transparent. Set the Stroke color by holding the Shift while clicking on the red square in the Palette. Set the opacity to 50% using the entry box marked O: in the Style Indicator at the lower left of the Inkscape window.
Now we are ready to adjust the circle. Set the stroke width to match the width of the original circle by either selecting the width from the pop-up menu accessed by a Right Mouse Click on the number next to the Stroke color in the Style Indicator (a tool tip will display Stroke width: x px when the cursor is over the number) or, if finer control is required, by setting using the Width entry box under the Stroke style tab of the Fill and Stroke dialog ( → (Shift+Ctrl+F)).
Next, adjust the size of the circle by dragging either of the two square handles (on left and top of circle). The handles are visible (by default) when any of the shape tools or the Node Tool is selected. Hold down the Ctrl down while dragging to preserve the circle shape. Tapping the Space bar will change to the Select Tool for repositioning the circle. Fine adjustments to the position can be made by holding the Alt key down while using the arrow keys. Tapping the Space bar a second time will reselect the Ellipse Tool.
By this time, you will have realized that the original outer circle is not a true circle. This is because the logo in the photograph is at an angle with respect to the plane of the photograph so the original circle is distorted. We will keep the true circle for the logo but keep in mind that we may need to make other corrections.
The final steps for the outer circle are to delete the original circle and change the stroke of the new circle to a solid black.
The inner solid black circle can also be replaced following the same steps as for replacing the outer circle with two minor changes: 1. Use a filled circle without a stroke. 2. Place the new circle behind the Yang object with the → (Page Down) command (also available from the Select Tool-Tool Controls).
Clean up the lettering.
It is now time to clean up the letters. Again we must break up the path into pieces (Shift+Ctrl+K)). After doing so, you'll see one big black square. I don't have to remind you not to panic, do I? Select the square and delete it; you should now see a big black circle. Delete that too (select it by clicking its edge). You should now see letters. While we are at it, delete the center black circle leaving only the letters.→ (
Notice that the A, O, P, and two R's are missing their holes. (You are not panicking, right?) This is because they are each composed of two paths that need to be put back together. We can do this for each of the letters, but in this case it is more convenient to select all the letter paths and merge them into one path using the → (Ctrl+K) command. (A rubber-band selection would work well here.)
It is time to rejoin the Yin and Yang as well as the circles with the text. Select the Yin and Yang, and the circles and use the Transform dialog to move them −500 pixels in the horizontal direction.
One can now see that the lettering isn't quite spaced correctly. This is again due to the orientation of the logo in the original picture. The lettering needs to be widened a little bit. Select the lettering path and scale it by 3% in the horizontal direction using the Scale tab of the Transform dialog.
The logo is now finished. You can either delete or hide the original photograph. (Select the “Photograph” Layer in the Status Bar and then either click on the icon to unlock the layer and then select and delete the photograph, or click on the icon to hide the Layer.) You can also make fine adjustments to the Yin path with the Node Tool if desired. Save your work as in the previous tutorials.
|© 2005-2017 Tavmjong Bah.||Get the Book or EBook.|