# Compare-Image

Compares two images and optionally saves a difference mask.

Project

ImagePlayground

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

[View on GitHub](https://github.com/EvotecIT/ImagePlayground) [Visit Website](#) [Releases](https://github.com/EvotecIT/ImagePlayground/releases) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/ImagePlayground)

Stars **102**

Forks **7**

Open issues 

Total downloads **708,853**

Release **ImagePlayground-PowerShellModule.v3.2.7**

Language: C# Updated: 2026-11-18

Command 

**Module**

`ImagePlayground`

**Inputs**

`System.String`

Compares two images and optionally saves a difference mask.

## Syntax

```
Compare-Image
[-FilePath] <String>
[-FilePathToCompare] <String>
[[-OutputPath] <String>]
[<CommonParameters>]
```

[#](#method-compare-image-string-string-string)

Parameter set: `All Parameter Sets`

## Description

When OutputPath is omitted, the cmdlet writes the comparison result to the pipeline instead of creating a file.

## Examples

### Compare two images

```powershell
Compare-Image -FilePath img1.png -FilePathToCompare img2.png
```

## Parameters

**-FilePath String requiredposition: 0pipeline: True (ByValue)**

First image path.

**-FilePathToCompare String requiredposition: 1**

Second image path.

**-OutputPath String optionalposition: 2**

When provided, the cmdlet writes a visual difference image instead of only returning the comparison result.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:624ACA22E68D57002E095640F2261F2046C4DD1AD6FBE21AC49FC9E9F9D57C1D -->
