Project

ImagePlayground

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

Stars 101
Forks 7
Total downloads 711,982
Release ImagePlayground-PowerShellModule.v3.2.7
Language: C# Updated: 2026-10-26
Command

New-ImageCrop

Module
ImagePlayground
Inputs
System.String

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

Syntax

New-ImageCrop
[-FilePath] <String>
[-Height <Int32>]
[-Open]
[-OutputPath] <String>
[-Width <Int32>]
[-X <Int32>]
[-Y <Int32>]
[<CommonParameters>]
#
Parameter set: Rectangle
New-ImageCrop
[-CenterX <Single>]
[-CenterY <Single>]
[-FilePath] <String>
[-Open]
[-OutputPath] <String>
[-Radius <Single>]
[<CommonParameters>]
#
Parameter set: Circle
New-ImageCrop
[-FilePath] <String>
[-Open]
[-OutputPath] <String>
[-Points <PointF[]>]
[<CommonParameters>]
#
Parameter set: Polygon

Examples

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

Parameters

-FilePath String requiredposition: 0pipeline: True (ByValue)
Path to the image being cropped.
-Height Int32 optionalsets: Rectangle
Height of the rectangle.
-Open SwitchParameter optional
Open the cropped file after creation.
-OutputPath String requiredposition: 1
Where to save the cropped image.
-Width Int32 optionalsets: Rectangle
Width of the rectangle.
-X Int32 optionalsets: Rectangle
X coordinate for rectangle cropping.
-Y Int32 optionalsets: Rectangle
Y coordinate for rectangle cropping.
-CenterX Single optionalsets: Circle
X coordinate of the circle center.
-CenterY Single optionalsets: Circle
Y coordinate of the circle center.
-Radius Single optionalsets: Circle
Radius of the circle.
-Points PointF[] optionalsets: Polygon
Points describing a polygon.

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.