How to Subset a Image in the shape of Polygon from a geocoded Image

It is not exactly possible to create an image shaped like a polygon because images are always rectangular. Except the polygon is a rectangle.
However, you can import the shape and then use (misuse) the Land/Sea Mask processor (Raster->Masks-> Land/Sea Mask). Select the imported shape at ‘Use Vector as Mask’.
This will mask out all pixels outside the shape.

You can also use gpt on the command line.
Use the Subset op and specify the geoRegion parameter.
This will create a subset using the bounding box of the given polygon.
type gpt Subset -h for more help on the command line.

1 Like