Lesson: Basic Drawing Tools For this lesson we'll take a step back from photographs, and learn how to use the gimp for drawing. Let's start with a blank canvas: File->New. You can make it any size you want, but it might be best to give yourself some space, say 640x480 or larger. A New Image window will open up filled with the current background color. It's probably white, if you haven't changed it, and that's a good canvas color for practicing drawing, though you can use any color you like. The easiest drawing tool is the pencil tool: its tooltip is "Paint hard-edged pixels". Select it. Change the foreground color, too, if you wish, by clicking on the color swatch in the toolbox, just as we've done in earlier lessons. Go ahead and scribble on the canvas now! You should see a thick line in whatever color you've chosen. If you don't, then skip ahead to "Reasons drawing might not work", then come back to this point afterward. What if you don't want such a thick line? Most of the drawing tools have the notion of a "current brush". This controls the size and shape of the stroke you make, and whether it has hard or fuzzy edges. (This is somewhat confusing, because the pencil tool can only draw hard-edged lines, even if you choose a fuzzy brush.) To change the line you make, you need to change the All versions of gimp have the Brush dialog: File->Dialogs->Brushes. This dialog shows you all the brushes available to you. Try picking a smaller or larger brush, then draw some more lines to see the effect. In gimp 2, you can change the brush without needing the brushes dialog: there's a Brush option menu in the Tool Options (most likely in the bottom half of the toolbox window). Use this or the dialog, whichever feels most comfortable for you. Notice, when you choose a brush, that the brush shows up as one of the three boxes on the right side of the toolbox, just to the right of the color swatches. You can click there to open the Brushes dialog. The other two items there are the Pattern and the Gradient; I'll talk about patterns in a moment, and gradients in a later lesson. Some of the brushes are a little silly -- like the Pepper. You can import other brushes (they go in ~/.gimp-n.n/brushes) if you see one somewhere you like. What if you want to use some of those fuzzy brushes? Select the paintbrush tool, right next to the pencil in the toolbox (the tooltip says "Paint fuzzy brush strokes"). Try the paintbrush with both hard-edged brushes and fuzzy ones, and compare how it draws with hard-edged brushes to how the pencil tool draws. They're fairly different, and you can choose the one you need. Two other line-drawing tools: - Airbrush. This paints a fuzzy dim line, but if you stay a long time in one place, the line will get darker, as though you were spraying paint from an airbrush. This tool also responds to pressure if you have special hardware such as a wacom drawing tablet and have it set up properly in linux. - Ink pen. This lets you change the shape and angle of the brush, rather than using the standard brushes; it's good for calligraphy. It's especially good if you have a drawing tablet with pressure. What if you want to draw a straight line? That's easy: shift-click. Click once (without the shift key) where you want the line to start, move to the other end of the line, and hold down the shift key. Gimp will show you where the line will be: and when you click (still holding shift), it will draw a straight line, using the current tool, color, and brush. Drawing, like most things in gimp, is undoable. If you've been scribbling away trying out some of these things, try undoing now: hit ctrl-Z repeatedly and watch your lines and squiggles disappear one by one, until you hit the limit of Gimp's Undo buffer. (This is configurable: in File->Preferences there's a setting for the size of the undo stack. Larger means more room for correcting oopses, but gimp will take up more memory.) How about shapes? Most of the time, the Bucket Fill tool is the one to use when you want a filled shape, like a circle or rectangle. First make a selection where you want the shape to be, using the rectangle or ellipse selection tool from lesson 4. Then select Bucket Fill -- it looks like it's pouring paint from a paint can -- and click inside the selection. It should fill with the foreground color. Bucket Fill has some interesting options, though. First, you can "fill whole selection" or "fill similar colors". "Whole selection" is obvious, and is most often what you want. "Similar colors" is a bit trickier: you can click on a pixel in a photograph, and bucket fill will try to fill nearby colors that are "similar enough" to the place where you clicked. You can adjust how similar they need to be with the Threshold slider. This can do strange things to your image; try it, if you have a photo loaded in gimp, but don't be surprised if you have to Undo. In addition, you can Bucket Fill with the background color instead of the foreground color -- this is no big deal since you can switch them at any time (by clicking on the arrow to the upper right of the two color swatches in the toolbox); but you can also bucket fill with a pattern. Try it now: click Pattern Fill in the tool options dialog, select an area in the image, then click inside it. The currently chosen pattern is shown in a little square in the toolbox, just to the right of the active brush. Clicking on it brings up the Patterns dialog, where you can choose from a wide selection. Try some of them! Click on a pattern in the Patterns dialog (notice that the active pattern shown in the toolbox changes), then go back to the image and click on your selection (with the Bucket Fill options set to "Fill whole selection"). You already know how to make rectangular and ellipse shapes, and fill those with bucket fill, but how about other shapes? Try the Lasso Select tool: it's immediately to the right of Ellipse Select, and it looks like a lasso. With this tool, you can draw any shape freehand, and the selection will follow that shape. Try drawing a specific shape now; then switch to bucket fill and click inside your shape to fill with a color or a pattern. Two final techniques left to talk about. One is the eraser (located near the paintbrush), which does the obvious. Well, almost obvious; it will erase to transparent if your image has any transparency (we'll talk about that in a later lesson). The other is that whenever you have something selected, you can Edit->Cut or Edit->Clear to erase the whole selection. (The difference is that Cut copies so that you can paste it later, whereas Clear just erases it.) Here's the image I have left after scribbling around while writing this lesson. It looks like something out of Tux Paint. http://shallowsky.com/images/gimpcourse/lesson5/mittenfault-draw.jpg DRAWING ON TOP OF IMAGES For this lesson, we've started with a blank canvas. But you can draw on top of a photo, too! For instance, how about cartoon thought bubbles, like Poppy's cat had in Lesson 4? First: If you do any drawing on top of photos, I very strongly recommend that you do your drawing in a separate layer. Go to the layers dialog, and click the New Layer button at the bottom left of the dialog. Now, any drawing you do will be optional: if you erase, you'll erase your drawing, not the original image, and if you decide you don't like your drawing, you can throw it all away and the image underneath will be fine. Eventually, you'll find that it becomes natural to use lots of layers: a base layer for the original image, a layer for the insert, a layer for the insert's drop shadow, a layer for drawing in white, a layer for adding some text in black ... Keeping each of these operations separate, and saving a copy as XCF as well as the JPG or other common format, makes it really easy to go back and change anything later. First I open an image: http://shallowsky.com/images/gimpcourse/lesson5/coots.jpg Next I want some text, because I can't make the thought bubble until I know how big the text is going to be. I'll go ahead and make it in black even though that doesn't show up, since I'm going to use a white bubble. I won't bother to save an intermediate showing that, because you can't really read the text anyway. Now I'll make a new layer to hold my thought bubble. It needs to be transparent (which is the default). So I click the New Layer button, and in the "Create a New Layer" dialog, I'll change the layer name to be "thought bubble" so it will be easy to remember which layer is which. I click OK, and the new layer is created. But here's a slightly tricky part: I need the thought bubble to be underneath the text, not on top of it: the bubble layer needs to be in between the Background and the text layer. Right now, the thought bubble is on top, and if I draw a while area on it, that white area will hide the text behind it. So I move the "thought bubble" layer down, using the down arrow button in the Layers dialog. The down and up arrows always move the currently selected layer. I'm finally ready to draw! I'll make my bubble oval: so I use the elliptical selection tool until I have an oval just the right size. Then switch to the bucket fill tool, set the color to white (or pick "BG color fill" if the background color is already white), and click inside the oval but not on top of the text. Voila! A white thought bubble layer under the text. Now it looks like this: http://shallowsky.com/images/gimpcourse/lesson5/coots-bubble.jpg Notice that the text isn't really centered on the bubble? It's fairly difficult to control exactly where an elliptical selection will end up, but now that I have a filled oval, all I have to do is switch to the move tool, and drag that layer around until I'm happy with its placement. I'm not quite done yet, though. I still need some little dots to link the thought bubble to the bird doing the thinking. I can either make another new layer for that, or draw it on the thought bubble layer. I'm going to make a new layer for it. Why? (1) it means I can change to a different shaped thought bubble layer, and (2) it means I can change my mind layer about which bird is doing the thinking, and replace just that part. It isn't critical whether this new layer is above or below the thought bubble layer or text layer, because it won't overlap with either one of them. It's only when layers overlap that you need to worry about which one is on top. On this new layer (I called it "bubbles") I'll make several small circular selections and fill them each with white. http://shallowsky.com/images/gimpcourse/lesson5/coots-allbubbles.jpg But there's still something missing. The small bubbles are hard to see against that busy background. Okay, class, what do we do when we want to make something stand out? You, there in the front row. That's right! A drop shadow! I make a drop shadow on the thought bubble layer, and another one on the bubbles layer: http://shallowsky.com/images/gimpcourse/lesson5/coots-done.jpg Don't forget to save your image as .xcf as well as a .jpg! That way you can go back and make changes to any of these layers at any time. Here's what my layers dialog looks like now (GIMP can take a screen shot with: File->Aquire->Screen Shot... then click on the window you want to capture): http://shallowsky.com/images/gimpcourse/lesson5/layersdialog.jpg GIMP WON'T DRAW ANYTHING -- WHY? No, sometimes you select a drawing tool, your color and brush are set properly, and GIMP just won't draw anything! Unfortunately there are lots of reasons this can happen. Here are some things to check: - If you have a selection, gimp will only draw inside it. So check whether you have one, perhaps an invisible one: check View->Show Selection and make sure it's checked (so you'll see the "marching ants" wherever there's a selection), and then, to be sure, do Select->None. - Check the Layers dialog. Is the right layer selected, and visible? - Check the Tool Options for the tool you're using. Many of these tools have a "Mode". You want this set to Normal. If it's set to anything else, then what gets drawn will depend on what's underneath. Sometimes this can be cool (try some of them, if you want!) but sometimes it means that nothing will be drawn. The discussion of modes in the GIMP manual is at http://docs.gimp.org/en/go01.html -- search for "Layer Modes", which is under M, not L; another good page if you're curious about modes is http://www.pegtop.net/delphi/blendmodes/ - Layers also have a mode. Go to the Layers dialog and make sure the Mode there is Normal as well. - While you're in the Layers dialog, make sure "Keep Transparency" isn't turned on for this layer. That's the checkbox to the right of the Mode option menu; in Gimp 1.2 it's labelled "Keep Trans." but in Gimp 2 it only has a little checkerboard next to it. You want this NOT checked, for now. I recommend that you keep this list handy. You WILL find times when it doesn't draw and you're not sure why, and you will probably forget some of the possible things to check. At least, I do. If you find other reasons that I haven't listed, please let me know!