Project

ImagePlayground

Automate image processing, codes, metadata, charts, topology, and visual stories from PowerShell.

Stars 100
Forks 7
Total downloads 712,347
Release ImagePlayground-PowerShellModule.v3.2.7
Language: C# Updated: 2026-08-25

API Reference

Command

New-ImageCrop

Namespace ImagePlayground
Inputs
System.String

Creates a cropped version of an image using rectangular, circular or polygonal areas.

Remarks

Creates a cropped version of an image using rectangular, circular or polygonal areas.

Examples

Authored help example

Crop using rectangle


New-ImageCrop -FilePath in.png -OutputPath out.png -X 10 -Y 10 -Width 100 -Height 100
        

Crop using circle


New-ImageCrop -FilePath in.png -OutputPath out.png -CenterX 50 -CenterY 50 -Radius 25
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

New-ImageCrop -FilePath <String> [-Height <Int32>] [-Open] -OutputPath <String> [-Width <Int32>] [-X <Int32>] [-Y <Int32>] [<CommonParameters>]
#
Parameter set: Rectangle

Parameters

FilePath String requiredposition: 0pipeline: True (ByValue)
Path to the image being cropped.
Height Int32 optionalposition: namedpipeline: False
Height of the rectangle.
Open SwitchParameter optionalposition: namedpipeline: False
Open the cropped file after creation.
OutputPath String requiredposition: 1pipeline: False
Where to save the cropped image.
Width Int32 optionalposition: namedpipeline: False
Width of the rectangle.
X Int32 optionalposition: namedpipeline: False
X coordinate for rectangle cropping.
Y Int32 optionalposition: namedpipeline: False
Y coordinate for rectangle cropping.
New-ImageCrop [-CenterX <Single>] [-CenterY <Single>] -FilePath <String> [-Open] -OutputPath <String> [-Radius <Single>] [<CommonParameters>]
#
Parameter set: Circle

Parameters

CenterX Single optionalposition: namedpipeline: False
X coordinate of the circle center.
CenterY Single optionalposition: namedpipeline: False
Y coordinate of the circle center.
FilePath String requiredposition: 0pipeline: True (ByValue)
Path to the image being cropped.
Open SwitchParameter optionalposition: namedpipeline: False
Open the cropped file after creation.
OutputPath String requiredposition: 1pipeline: False
Where to save the cropped image.
Radius Single optionalposition: namedpipeline: False
Radius of the circle.
New-ImageCrop -FilePath <String> [-Open] -OutputPath <String> [-Points <PointF[]>] [<CommonParameters>]
#
Parameter set: Polygon

Parameters

FilePath String requiredposition: 0pipeline: True (ByValue)
Path to the image being cropped.
Open SwitchParameter optionalposition: namedpipeline: False
Open the cropped file after creation.
OutputPath String requiredposition: 1pipeline: False
Where to save the cropped image.
Points PointF[] optionalposition: namedpipeline: False
Points describing a polygon.