How do I draw a box in GIMP?

I want to draw a box around a portion of my graphic for the purpose of highlighting it.

How can I do that?

4

6 Answers

Use the rectangle selection box, and under the Edit menu, hit Stroke Selection. Select your options from there, and hit "Stroke" to apply the stroke.

13

Select Filters > Render > Gfig... From there you can draw boxes and other shapes boxes in various styles.

enter image description here

5

Use the box select tool, then Select >> Border This selects around your current selection's outline (dotted animated line), at a distance of however many pixels you enter in the dialog box on either side of original line. i.e. if you use 5 for Border's input value, you will have a 10 px wide border selected. Then fill it in with paint bucket. You now have a box. Or... fill a layer with any colour, pattern, gradient, image etc., and use the selection to create a black box in a white layer mask using the same selection. Select all on layer mask, and gaussian blur a bit. That will give you a blurred border, using whatever image is on the layer. Everything that is black on the layer mask will be transparent to the layer below. Using this image as the main layer, I created a thick blurred border, but started with a circle selection instead of a square. I also did a border select on the original border select (after filling in layer mask) to blur the edges of my new border, and not the whole border.

Original:

New Border

Example using black layer instead of image, and rounded corners.

5

@Aeo answer is not clear enough:

  1. First use the Rectangle Selection to draw your rectangle/boxenter image description hereenter image description here
  2. Only then, go under the Edit menu, and hit Stroke Selection.enter image description here
1

After going through all these convoluted answers, I figured out a simpler one.

Create a new layer. Set the opacity to 50%. Set your foreground color to yellow (or whatever). Click the Rectangle Select tool. Draw a box around the text you want to highlight. Don't hit enter. Go immediately to the edit tab, and select Fill with foreground Color. Hit enter. Ta Da!

Create keyboard shortcuts for it

If you are using this a lot, create custom keyboard shortcuts for it as mentioned at:

  • Edit
  • Preferences
  • Interface
  • Configure keyboard shortcuts

Then, search for: "Stroke Selection".

Two possibilities open up, and I set:

  • "Stroke Selection": "Ctrl + Alt + ,"
  • "Stroke Selection...": "Ctrl + Alt + ."

These are inspired by the similar predefined fill shortcuts "Ctrl + ," and "Ctrl + .".

Now:

  • "Ctrl + Alt + .": used for the first stroke. This opens the menu of stroke properties, from which you can select stroke parameters such as line width.
  • "Ctrl + Alt + ,": strokes immediately with the previously selected stroke properties

Also note that you can make multiple rectangular strokes at once by selecting multiple rectangular selections at once by holding Shift:

enter image description here

and then after "Ctrl + Alt + ," it immediately becomes:

enter image description here

Tested on Gimp 2.10.18.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like