# Gimp.Image.prototype.select_polygon

    function select_polygon(operation: Gimp.ChannelOps, segs: Array(Number(gdouble))): Boolean {
        // Gjs wrapper for gimp_image_select_polygon()
    }

Create a polygonal selection over the specified image.

This tool creates a polygonal selection over the specified image. The polygonal region can be either added to, subtracted from, or replace the contents of the previous selection mask. The polygon is specified through an array of floating point numbers and its length. The length of array must be 2n, where n is the number of points. Each point is defined by 2 floating point values which correspond to the x and y coordinates. If the final point does not connect to the starting point, a connecting segment is automatically added.

This procedure is affected by the following context setters: Gimp.context_set_antialias, Gimp.context_set_feather, Gimp.context_set_feather_radius.

Since 2.8

operation

  The selection operation.

segs

  Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}.

Returns

  TRUE on success.