How to Draw a Rectangle/Square/Box in GIMP

You probably noticed that the title of this post is a bit odd, but however you got here, I can show you how to draw any kind of shape you want in GIMP using a few simple tools. Like most things in GIMP, there are several ways you can do this job, so let’s start with the simplest one.

Method 1: Making a Solid Shape

This method will allow you to create solid shapes filled with a single color, a pattern, or a gradient. If you want to create an outlined shape, try Method 2 or Method 3. 

Step 1: Create A Selection

With your image open in GIMP, switch to the Rectangle Select tool using the toolbox or by pressing the keyboard shortcut R

Click and drag on your image to create your chosen rectangle or square. GIMP will outline the selection and provide adjustment handles at the four corners for resizing, and along each edge for constrained resizing along a single edge (although these will be hidden until you hover the cursor over the selection). 

A square selection in GIMP 2.10, with the corner adjustment handles visible

You can also hold down the Alt key (Option on a Mac) and click and drag to reposition your entire selection area. 

The Tool Options panel, showing the available options for the Rectangle Select tool

If you want to be precise about the location without having to place the selection by hand, you can also use the Tool Options panel on the left dock to type in a specific location and size, based on the upper left corner of the selection area. 

You’ll need to have started drawing a selection already, and GIMP will reposition it for you based on your input.

Once you’re happy with the size and position of your selection, press the Enter key to finalize it. 

Step 2: Fill Your Selection

Now for the fun part! If you want to fill your selection area with a solid color, select it using the color picker at the bottom of the toolbox. The upper left color swatch is your foreground color, and the bottom right color swatch is your background color. 

The Bucket Fill tool options

Switch to the Bucket Fill tool using the toolbox or the keyboard shortcut Shift + B. Check the Tool Options panel and make sure the Fill Type is set to FB color fill (although you can use BG color fill or Pattern fill if you want to), and Affected Area is set to Whole Selection.

Then simply click anywhere inside your selection, and GIMP will fill it with your chosen color or pattern. 

The selection is now filled with the foreground color

If you don’t want to use the Bucket Fill tool, you can quickly fill a selection area with the current foreground color by pressing Ctrl +, (that’s a comma, in case it isn’t clear) or fill with the current background color by pressing Ctrl + . (that’s a period, even though my grammar checker is mad about it).

You can also fill your selection with a gradient by switching to the Gradient tool, which is nested in the toolbox underneath the Bucket Fill tool, or you can use the keyboard shortcut G. Set your Tool Options as desired, and then click and drag anywhere inside your selection to fill with your chosen gradient settings. 

GIMP showing off a basic gradient fill

You can repeat this process as many times as you want, although I recommend that you put each different rectangle/square/box on a separate layer so that you can move them around independently of each other later on. 

Method 2: Making An Outlined Shape

This method is fairly similar to Method 1, although we’ll use a different technique to create an outline of the selection instead of using a solid color, gradient, or pattern fill. 

Step 1: Create A Selection

Create your selection as before using the Rectangle Select tool. I won’t rehash the same details over again, since this is a fairly basic step. 

Step 2: Apply A Stroke

If you’re not familiar with the terminology, this isn’t some scary medical condition that can affect your image. Instead, applying a stroke essentially means drawing a line or brushstroke around the selection area. 

Open the Edit menu, and click Stroke Selection.

I’m not sure why this is in the Edit menu instead of the Select menu

GIMP will open up the Stroke Selection dialog box, which is full of all sorts of ways to customize the stroke that will be applied to your selection. 

You can apply a simple line, a pattern, or even a paint tool complete with emulated brush input dynamics, although these dynamics won’t be as effective as if you’d actually hand-drawn the stroke. 

Choose all your settings, and click the Stroke button to finalize it. 

This is probably the most flexible way of creating a rectangle/box/square in GIMP, and it can be combined with Method 1 or Method 3 to create more complex effects. 

Method 3: Drawing Straight Lines In GIMP

If you don’t want to use either of the selection methods, there’s one last option that might work for you. 

It’s possible to draw perfectly straight lines in GIMP using one of the many brush tools – and I don’t mean cheating by using a ruler on your drawing tablet, which is silly. Usually, I wholeheartedly approve of silly things, but you don’t want to damage your tablet’s drawing surface! 

This method has the advantage that it works with any of GIMP’s brush-based tools, from the Paintbrush to the Clone tool, which creates some interesting possibilities depending on the settings you choose. 

Select your chosen tool, and click at a point where you’d like to have one corner of your shape. Hold down the Shift key, and move your mouse to the next corner. While you’re holding the Shift key, GIMP will automatically draw a straight line between the two points, showing the path that your auto-filled stroke will take. 

GIMP includes handy guidelines to show where the strokes will be drawn

However, that’s only good enough to draw straight lines. For a proper rectangle/square/box, we’ll need to constrain the angle too. While still holding down the Shift key, hold down the Ctrl key as well, which will constrain your angle to 15-degree increments. 

That will allow you to draw any kind of straight-edged polygon that you want, from squares to boxes to hypercubes!

About Thomas Boldt
I’ve been working with digital images since the year 2000 or so, when I got my first digital camera. I've tried many image editing programs. GIMP is a free and powerful software, but not exactly user-friendly until you get comfortable with it, and I wanted to make the learning process easier for you here.

Leave a Reply

Your email address will not be published.

  • Serkan

    This page helped my elementary Gimp drawing skills a lot. Keep up the good work!

    Reply