The Designmark Graphics blog
Quality tutorials for Inkscape and GIMP
Quite a few design websites, and their blogs in particular, use art and drawing equipment imagery on their pages. It makes sense - it's an appropriate setting and helps to assert in the site visitor's mind what occupation the website owner is conveying. Here we're going to learn a nice, fairly easy method to create a vector pencil with some lighting touches to add a subtle feeling of depth and realism. It's not too complicated but does make use of gradients a fair bit so familiarise yourself with this tool a little bit before we begin to make life easier. I'll break it down into easy steps for people who are less comfortable working with this feature.
Here's what we'll be working towards today:
Skills you'll be developing in this tutorial
- Building and editing shapes using the Rectangle, Pen and Node tools
- Creating and editing gradients using the Gradient tool
Open up Inkscape and switch on the guide grid by pressing # on the keyboard. Activate your rectangle tool (use R on the keyboard or choose from the toolbox), then click and drag to draw a long, thin, horizontal rectangle that's about 350 pixels (px) wide and 10 px tall. Fill this rectangle with a light blue colour using the Fill and Stroke dialog box - Ctrl, Shift and F, or click the fill box on Inkscape's bottom toolbar.
Convert this rectangle to a standard path, by pressing Ctrl, Shift and C on the keyboard, or by using the menus and selecting Object --> Convert to Path. Change to your Node tool (keyboard button F2 or the second-top tool in the box), then click and drag the shape's outline in the middle, to make the pencil's body bulge outwards. Experiment with it until you've got something of a fairly even curvature.
Now let's make a copy of this shape and create the second section of our pencil. Either use Edit --> Copy, then Edit --> Paste In Place in the menus, or take the keyboard shortcut route and press Ctrl and C, then Ctrl, Alt and V. This will create an exact copy of the original, and paste it directly over the top of the original. Click and drag this new shape to put it adjacent underneath, and change its fill slightly to a darker blue: R = 55, G = 149, B = 196.
Switch to your Pen tool (B on the keyboard) and, again using the grid, click on a sequence of grid intersections to draw the shape for the shaved part of the pencil. Line up the nodes so that they're against the main shaft of the pencil, then taper it off as you get towards the W-shape; in all this part should end up about 40px long. Keeping it selected, move this shape behind the rest of the pencil either by pressing Page Down on the keyboard or by hitting Object --> Lower in the menus. Change its colour to R = 185, G = 140, B = 55.
Using the Pen tool again, draw a small triangle at the very tip for the pencil lead itself. Make sure this is the topmost shape on our drawing so far by using Page Up or Object --> Raise in the menus. Change its fill colour to near-black: R = 2, G = 2, B = 2.
Let's add some highlights and shadows to start giving this drawing some life and an extra dimension. Move back to the main pencil stem, and Copy (Ctrl and C) and Paste in Place (Ctrl, Alt and V) the upper of your two original rectangles, like before. Head back to the Fill and Stroke panel and fill it with white, then switch to your Gradient tool (Ctrl and F1), and move your mouse over the white-blended rectangle you can now see. Click and drag a gradient from the top of the rectangle to the bottom, reduce the shape's opacity in the Fill and Stroke dialog box to around 25%, then sit back and admire your handywork for a moment.
That was quite a few steps but we've achieved a really powerful effect and it's one you can use in many ways and on many types of design. Duplicating a shape then using a low-opacity, gradient that fades out from white to transparent, creates the look of a shiny highlight.
We can take this effect even further, for more impact; repeat the above steps on the lower of the two rectangles, but this time use a dark grey shade, and drag the gradient up from the bottom of the pencil towards the middle. Now you've got light showing at the top and a slight shadow underneath.
What's even better about this method is that you can now change the colours of the solid rectangles underneath our highlights to easily make a whole range of differently-coloured shapes, all with the same light and dark effect for depth. Used with other consistent lights and shadows across an object on the page you can take something that looks very 2-dimensional and change it into something with some real depth and interest.
Let's repeat this trick with the sharpened area of the pencil, so we've got a consistent light across the whole object. Start by copying and pasting the shaved part of the pencil, then repeat the previous tactic to get a white-to-transparent gradient over it. Solve the problem of it overlapping the pencil's shaft by pressing Page Down a couple of times (it was four for me) to keep the highlight over the part we want only.
Copy and paste this highlight shape and flip it vertically using the button or by pressing V on the keyboard. Because it's the same total height as the pencil, this will have the added bonus of putting the flipped gradient exactly where we need it! Then all you've got to do is change the gradient's colour to grey (R = 113, G = 113, B = 113) and it's done.
When you're happy, lower these shapes' opacities to 80% for the white highlight, and 60% for the grey shadow. If you're zoomed in, take a step back and check over what you've done.
This is starting to look good now, so let's turn our attention to the other end of the object and add some details over there to finish things off. Firstly, draw a rectangle that fits against the pencil stem (switch your grid back on if, like me, you've turned it off). Make it 25 pixels wide and fill it with R = 145, G = 114, B = 51. Change this fill to a linear gradient, then click the 'Edit...' button to enter the Gradient Editor where we'll make some changes to this fill style.
Using the dropdown box, select the second 'Stop' on this gradient. Drag the Alpha (labelled simply, 'A') at the bottom so that it's all the way over to the right: this means a solid colour with no transparency on it. Then add a stop using the button above and, with that stop selected, use the middle section of the pop-up, which sets the colour of each point on the gradient, to change the middle part to R = 235, G = 185, B = 82. Finally, flip to your Gradient Tool and, just like before, click and drag the gradient so that goes across the rectangle from the top to the bottom.
Don't worry if you're not happy with the result of setting your colours using the Gradient Editor, you can always come back to it later by selecting it from the gradients list dropdown and clicking Edit to make alterations. What's more, any other shapes that share the same gradient will update automatically if you do make any adjustments.
Activating your rectangle tool again, draw two more shapes that overlap the first and extend slightly past the top and bottom as well. Zoom in really far and use the grid to help you out here. Hold down the Ctrl key, and click and drag the corner-rounder circle on each shape to round its edges like this:
Switch back to the Select tool, then click on each of your latest shapes and fill it with the gradient you created for the metal collar before; you can select it from the gradients dropdown list on the Fill and Stroke panel. If it happens to go in the wrong direction across your shapes, get your Gradient tool out again and correct it.
Last but not least, no designer's pencil is complete without an eraser on the end. Use the Pen tool to click four points of a rectangle level with the edge of our metal collar, then use the Node tool like we did earlier to sculpt the segment at one end to bend it outwards and round the tip nicely.
Fill it with a red-to-red gradient that has a lighter colour in the middle, using the same technique for creating gradients as we did for the collar. I'll show you what my gradient looks like in the next image.
Let's have a look at our finished product.
That's looking really nice. If we want to we can also add a few finishing touches to put the pencil in context and give it something to draw on, like this, for example.
Excellent work. The gradient stuff was pretty involved there but if you've got through that and ended up with something you like, you've just learned one of the most powerful techniques to add quality and professionalism to your Inkscape drawings.
Did you enjoy this tutorial? Made your own version and want to share it with us? Post in the comments section below and let me know what you think.
Be aware that all comments are moderated before being published on site. Please be considerate to others in any comments you post and please don't spam.
4868 comments (newest first)