Inkscape Introduction

Alright, time for that introduction to Inkscape I’ve been promising for a while. Today, we’ll be learning how to draw this delightful, delicious looking corn sprite:

Corn

The whole graphic is actually only made of about six distinct shapes, obviously some are reused to create the kernels, etc… Here’s the corn in its requisite pieces, we’ll be going letter by letter to make our corn:

cornDecomposed

Ready, set… Go!

Okay, first things first… go download Inkscape!! There are versions available for Windows, Linux and Mac, so take your pick, get installed and meet me back here. I’ll be waiting.

Phil_Yawn

Done? Ok, when you start up the program you should see a window like this:

Screenshot
(I’ll be doing this tutorial on a Windows machine, if you have trouble following along with shortcuts from Linux or Mac, leave me a note and I’ll post alternate tutorials)

a. Kernel One (a)

Let’s jump into making a kernel of corn (a). Go ahead and choose the circle tool (shortcut: e for ‘ellipsis’), draw yourself a nice oval (slightly wider than it is tall).

ScreenshotCircle

Now let’s hit up the Object Menu > Fill and Stroke.

ScreenshotFillStroke

The Fill and Stroke menu controls how your objects are colored and outlined in Inkscape. You can choose to define either your objects fill color, outline color, both, or neither. Although if you define neither, I’m not sure why you’re creating an object in the first place… I’ll lat you play around with the menu and tweak your circle until you’ve got it looking yellow and corny. And while we’re here, click around and see what you can do! There are options like linear gradient, circular gradient, pattern fill etc… And remember, ctrl+z is your best friend.

Screenshotkernel1

If you can’t get your kernel to look quite right, I’ve provided the exact colors below:

↑↑↓↓←→←→BA:
In the Fill tab, let's use the HSL tab (in the "Flat color" section) to set your color to fbff00ff.
Next, hit up the Stroke paint tab, HSL tab, color = ffda0bff.
Now, in the Stroke style tab set your width to whatever looks right. I can't really say how big your circle is so I can't tell you how big to make the outline. Take note of this value, we'll try to use the same value in other elements in order to keep everything looking consistent.

b. Kernel Two (b)

Let’s learn how to duplicate objects! It’s kinda like copy + paste but quicker. Click on your kernel we made in the last section and hit ctrl+d. Now just drag your object and voila! Another kernel. We’re going to want a slightly longer kernel in the x direction. To do this, we can grab the resize arrow on either the left or right edge of your object, and click & drag.

ScreenshotKernel2
Note: When you resize objects, inkscape will keep your outline width proportionate to your object’s size. You may want to check (in the stroke style tab) to see if your object width is still the same as your original kernel.

Simple, right? Cool. Let’s move on to some harder stuff.

c. Leaf One

c

For this section we’re going to start learning about paths. If you’re used to simpler bitmap editors like Paint or Paint.net, etc… these paths might feel a little awkward at first but worry not, they will soon become your best friend.

Start off choosing the bezier (bezier) tool either from the tool bar or just hit the “B” key on your keyboard. Once you have the tool selected, try drawing out a lightning bolt in the shape of the leaf above. To do this, just click anywhere on your canvas, then move your mouse to the next point on your lightning bolt and click again. Repeat until you are back at your original point, place your cursor on top of the original point and click. Your shape should complete itself.

screenshot_bizier
The bezier tool is very handy in allowing you to trace over pictures you’d like to vectorize. You can quickly outline and adjust paths to create smooth and beautiful curves

Nice work! Now, let’s change up that color scheme. Just like for the kernel from above, let’s go in and color this object like a leaf. The fill color should be 01c200ff and the stroke color should be 018000ff. Set the width in the stroke style tab to whatever looks right.

Now for something new – right under width is an option called ‘join’. These tell inkscape how to deal with the corners on your paths. See how sharp the corners are on our leaf right now? Let’s give them a softer look. Choose the middle option. It looks like a right angled road with a curved top right edge (join). Once this option is selected you should have nice, round corners on your leaf. Except… it still looks distinctively like a lightning bolt.

To  get your shape looking a little more leafy, hit F1 to switch to your select tool, click on your leaf to select it, and then hit F2 to switch to path editing mode. See the seven squares on your lightning bolt’s vertices? Those are called nodes. We’re going to focus on the four in the middle for now (see diagram).

Now, place your cursor over the node (it should turn red), hold down the ctrl key on your keyboard and click on the node. You should see the corner turn into a rounded edge. We have ‘smoothed’ this node. Go ahead and finish up smoothing the remaining three nodes. (Alternatively, you can click a node to select it, and then hit the ‘Make selected nodes smooth’ button nodesmooth in the toolbar.) This can be handy if you select a ton of nodes that you would like to smooth out at once.

Feel free to move around the nodes until you have a satisfactory looking leaf. Not only can you move nodes, but you can also alter the path in between the nodes. To do this, place your cursor on the path between two nodes, click, and drag. You’ll notice that the nodes that we smoothed earlier will try to stay smooth, regardless of how you move the path that it is attached to. Play around with it! If you start making graphics of your own, you’ll probably spend a lot of time tweaking and fine tuning your paths.

d. Leaf Two

d

Let’s blaze through this guy. This is the underside of our corn leaf. We can employ the same process from the last section in order to create this. Hit the ‘B’ key to bring up the Bezier tool, and draw the nodes where you think they should be. Now color your leaf as before, (fill: 01c200ff | stroke: 018000ff). Move your curves around and try to get it looking like the shape above.

The new concept we’ll cover with this shape is gradients. Gradients are a smooth change in color over a certain distance. Notice how there’s a transition from dark green to light green in the leaf above? That’s a gradient. Here, I wanted to emulate the top leaf casting a shadow on to the bottom one. To create a gradient, hit the ‘G‘ key on your keyboard, place your cursor on the left edge of your leaf, and drag to the right edge. If you messed up, you can go back and change the positioning on the gradient nodes with either the gradient tool, or the path edit tool (F2). You will notice that the gradient goes from green to transparent (it will look white). To fix this, hit F1, select your leaf, and look to your Fill and Stroke pane. In the Fill tab, you should see a gradient ‘Edit…’ button. Click that and inkscape will pop up a window that controls what colors are used in the gradient. Right now, it uses the green you selected for the object at one node, and a completely transparent color at the other node. To change the transparent color, click the arrow and choose the second color in the list (gradient). With the HSL tab selected in the ‘Stop Color’ section, look to the bar labelled ‘A’, which stands for ‘Alpha’. The alpha value for a color determines how transparent it is. Change the 0 value to 255 (max). Now you’ll see that your leaf is a solid green the whole way through. From here, you’ll want to play with the colors to see what kind of shadowing you like.

With the leaf selected, hit Ctrl+D to duplicate the leaf, and then hit H to flip it horizontally. Now we have two identical leaves that are mirror images of each other.

e. Line

e

This line is just that. A line. Use the Bezier tool (B) to draw a zig zag line thing, smooth the nodes, change the color and make sure it fits within the bounds of leaf one (c).

c+e=g4211

Repeat the duplication and mirroring we performed on leaf one in the previous section.

Before we move on to section f (corn shadow), we need to assemble the pieces from our previous sections together into something that starts to resemble a piece of corn. Remember kernels one and two? We want to stack them, one on top of the other, to form a column of kernels — just like you would see on a piece of corn. Go back to kernel one, and duplicate it (ctrl+d). Now drag it straight down. (Hint: Hold on to ‘ctrl‘ when dragging along the x or y axis in order to drag things in a straight line!) You should now have something like this: 

Kernel A, duplicated and dragged straight down

Now repeat this duplicate and drag process about ten times. Don’t worry about trying to space them out perfectly equidistant from one another, we’ll let the software worry about that. Once you have ten kernels in a column, open the ‘Align and Distribute’ menu (Object > Align and Distribute, or just Ctrl+Shift+A) Now, with the select tool active (F1), select all of your kernels and then hit the button on the ‘Align and Distribute’ menu that looks like this image4305. It’s located in the ‘Distribute’ section of the menu. It will align all the kernels’ horizontal centers equidistantly from one another. Alternatively, you can also distribute according to vertical centers.

unclumb

The unclumping tool can be very useful when trying to make large patterns like this. The entire ‘Align and Distribute’ menu is very useful, so spend some time to figure out what the other buttons do. (Just some examples: you can align one object to another through the x or y axis,  and distribute objects equidistantly from one another through either axis).

Now select all your kernels, and hit Ctrl+G to group this row of kernels together. Now hit Ctrl+D to duplicate, hold down the Ctrl button and drag horizontally to create two rows of the outer row of corn. Now repeat this process of duplicating, dragging and distributing kernels with kernel B, but make 11 kernels this time. Once you’re done, bring together the three rows of kernels into a cob like shape and group them together:

createcorn
Hint: use the align and distribute tools to make your rows line up perfectly.

Looking good! Let’s take a quick inventory of our objects now, you should have three rows of kernels, and two sets of leaves that are mirror images of each other. We could just combine our objects right now to create our corn, but let’s take the lesson one step further and add the shadow.

f. Shadow (path4782)

To create the shadow, we will be duplicating the three columns of kernels, combining them into one object, removing the boundary, and adjusting the color to a transparent black to mimic a shadow formed on the lower left half of the kernels. The new feature we’ll learn in this section are the path editors. We can make all sorts of interesting shapes, such as this shadow, with path operations.

By now, you should be pretty familiar with the tools we have learned about up to this point, so we’ll move pretty quickly — first, duplicate the grouped kernels we made in the last section (Ctrl+D). Then, un-group them to separate each individual kernel (hit Ctrl+Shift+D). We will need to un-group twice, since we grouped these kernels in two batches – once to form rows and again to form the cob. Now we will use a path editor: with all the kernels selected, go to the Path menu > Union (or alternatively, Ctrl++). Now, you’ll notice that our kernels aren’t completely combined into one object. That’s because the union tool only goes by the object fill size, the large outline around each kernel is not considered in the area used for the union. With the object selected, go to Path > Outset (or Ctrl+)). ‘Outset’ will expand your object to fill in the gaps (see the difference in the diagram below). Once we’ve done this, we can remove the stroke (Fill and Stroke toolbar, Stroke tab, remove stroke) and change the color (Fill tab) to a transparent black (I like 0000003c).

cobtransformtoshadow

Ok… now we have an object shaped like corn but colored like a shadow. Now we need to cut out some of it and lay it on top of the original kernels in order to produce the desired shadowy effect. To cut out some of the shadow, draw a circle, put it on top of the part of the shadow you’d like to cut out, select both objects and go to Path > Difference (Ctrl+-). It’s hard to explain in words so study the diagram below:

cutoutcircle
NOTE: It is usually bad design to mix shading techniques (as we used a gradient shading technique earlier in the article for leaf Two), but for the purposes of this article, we’ll play a little fast and loose with that rule :)

Congratulations! You’ve just made all the elements needed for an attractive piece of digital corn. The end result isn’t all that interesting or compelling, but the tools you’ve learned in this tutorial are all the ones I use on a daily basis, so it’s a very good starting point. Now you just need to layer these objects on top of one another and you should be good to go. A helpful tip when placing these objects on each other is that Page Up and Page Down will adjust the draw order of any object. So if your kernels end up on top of the leaves, hit ‘Page Down’ and they’ll move underneath them.

I’ve included the .SVG (scaleable vector graphic) file here in case you had any trouble following along. You should be able to open it in any vector editing software (Inkscape, Illustrator, etc…)

I hope you’ve learned something from this Inkscape Introduction! If anything was unclear or if you would like to learn more about any concept/technique in particular, leave me a comment below and I’ll get back to you/write a new post. Thanks for reading!

About Nabil

Thanks for visiting! I'm a software consultant, rock climbing enthusiast and I like to draw in my spare time. I hope you've been enjoying our work so far, feel free to drop us a few comments if you see anything you like! (Or don't like)

3 thoughts on “Inkscape Introduction