# Gimp.Selection.bounds

    function bounds(image: Gimp.Image): [ok: Boolean, non_empty: Boolean, x1: Number(gint), y1: Number(gint), x2: Number(gint), y2: Number(gint)] {
        // Gjs wrapper for gimp_selection_bounds()
    }

Find the bounding box of the current selection.

This procedure returns whether there is a selection for the specified image. If there is one, the upper left and lower right corners of the bounding box are returned. These coordinates are relative to the image. Please note that the pixel specified by the lower right coordinate of the bounding box is not part of the selection. The selection ends at the upper left corner of this pixel. This means the width of the selection can be calculated as (x2 - x1), its height as (y2 - y1).

image

  The image.

ok

  TRUE on success.

non_empty

  TRUE if there is a selection.

x1

  x coordinate of upper left corner of selection bounds.

y1

  y coordinate of upper left corner of selection bounds.

x2

  x coordinate of lower right corner of selection bounds.

y2

  y coordinate of lower right corner of selection bounds.