35

Oftentimes, I need to measure the dimensions of part of an image (in pixels). In Photoshop, I can make a rectangular selection and see the dimensions in the "Info" window (or something like that). How can I accomplish this in GIMP? The only thing I've been able to come up with is:

  1. Make a selection
  2. Make a new layer
  3. Fill the selection
  4. Autocrop the layer
  5. Open the scale layer dialog to see the dimensions

There must be an easier way.

Robotnik
  • 2,645

6 Answers6

38

In GIMP, the status bar at the bottom of the window will show you the dimensions while you are selecting, but it disappears when you finalize the selection. I suspect that is because the selection can be shapes other than rectangle. If you want to see it afterwards, make sure the Windows --> Dockable Dialogs --> Tool Options pane is enabled. It may already be docked on your Toolbox. This will show you the position and size of a Rectangle Select. You can also modify the size of the selection from this pane.

I am using GIMP 2.8 on Windows.

GuitarPicker
  • 1,730
5

If the above solutions are inelegible and your selection equals the current layer, you might also measure the size of the layer using "Layer" -> "Scale Layer".

phil294
  • 349
  • 4
  • 14
2

GIMP shows the ongoing selection dimensions in the status bar, just on the bottom of the window. enter image description here If that is not enough for some reason, there is a "measurement tool" you can pick on the toolbox (on the default configuration, just following the "zoom tool") - which will give you any linear size, and also angles of measured lines.

jsbueno
  • 908
1

Information about the current selection can be found, even before/after using the selection tools. In Gimp 2.10, this data is exposed using the pdb.gimp_selection_bounds() function, which can be run from the Python Console (Filters/Python-Fu/Console):

>>> [pdb.gimp_selection_bounds(img) for img in gimp.image_list()]
[(1, 124, 180, 310, 257)]

The 1 here indicates that the selection is not empty, the 124 and 180 show the x and y starting points for the selection, and the 310 and 257 show the x and y ending points for the selection. Note that no matter how complex your selection is, you will still only get back information for a single rectangle encompassing all components of the selection. If you feather a selection, the dimensions will expand to cover even the slightest % selected pixels. There will be more than one entry in the list if you have more than one image open.

>>> pdb.gimp_selection_bounds(gimp.image_list()[0])
(1, 98, 130, 254, 216)

If you know what index the image you care about is in the gimp image list, you can pick it out directly so you don't have to sift through the others.

>>> bounds = [pdb.gimp_selection_bounds(img) for img in gimp.image_list()]
>>> [(bool(b[0]), b[3] - b[1], b[4] - b[2]) for b in bounds]
[(False, 1920, 1080)]

With a little extra work, we can calculate the size of the selection based on the bounds we get back. Here we see that there is no selection; the dimensions of the image are shown instead.

>>> bounds = [pdb.gimp_selection_bounds(img) for img in gimp.image_list()]
>>> [(bool(b[0]), b[3] - b[1], b[4] - b[2]) for b in bounds]
[(True, 186, 77)]

Here we see that there is a selection, and the width and height of the current selection are calculated.

All of this can also be run from the Script-Fu console, but the code will look a little different. For more frequent use, I would recommend creating a plugin to pop up an info box and assigning a keyboard shortcut, but that's a solution I'll leave to the reader.

pydsigner
  • 136
1

I can't help posting here - just use Paint.net, it shows immediately all the info about your selection—the area in pixels, sq.cm., and even the bounding rectangle size.

off-signer
  • 137
  • 8
0

In the tool options window for rectangle select, you can see the size values

enter image description here