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

ConvertTo-Image

Namespace ImagePlayground
Inputs
System.String

Converts an image to a different format.

Remarks

Outputs a new file using the extension from OutputPath. When OutputPath ends with .ico, the file is only copied if the source file is also an icon.

Examples

Authored help example

Convert PNG to JPEG


ConvertTo-Image -FilePath image.png -OutputPath image.jpg -Quality 85
        

Convert JPEG to PNG


ConvertTo-Image -FilePath photo.jpg -OutputPath photo.png -CompressionLevel 6
        

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

ConvertTo-Image [-CompressionLevel <Int32>] -FilePath <String> -OutputPath <String> [-Quality <Int32>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

CompressionLevel Int32 optionalposition: namedpipeline: False
Compression level for PNG images.
FilePath String requiredposition: 0pipeline: True (ByValue)
The file must exist.
OutputPath String requiredposition: 1pipeline: False
The extension determines the output format.
Quality Int32 optionalposition: namedpipeline: False
Quality for JPEG or WEBP images.