Table of Contents

Method Compare

Namespace
SkiaSharp.Extended
Assembly
SkiaSharp.Extended.dll

Compare(string, string)

Compares two images loaded from file paths pixel by pixel.

public static SKPixelComparisonResult Compare(string firstFilename, string secondFilename)

Parameters

firstFilename string

The file path of the first image.

secondFilename string

The file path of the second image.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKBitmap, SKBitmap)

Compares two bitmaps pixel by pixel.

public static SKPixelComparisonResult Compare(SKBitmap first, SKBitmap second)

Parameters

first SKBitmap

The first bitmap.

second SKBitmap

The second bitmap.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKPixmap, SKPixmap)

Compares two pixmaps pixel by pixel.

public static SKPixelComparisonResult Compare(SKPixmap first, SKPixmap second)

Parameters

first SKPixmap

The first pixmap.

second SKPixmap

The second pixmap.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKImage, SKImage)

Compares two images pixel by pixel.

public static SKPixelComparisonResult Compare(SKImage first, SKImage second)

Parameters

first SKImage

The first image.

second SKImage

The second image.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Exceptions

ArgumentNullException

first or second is null.

InvalidOperationException

The images have different dimensions.

Compare(string, string, SKPixelComparerOptions?)

Compares two images loaded from file paths pixel by pixel, using the specified comparison options.

public static SKPixelComparisonResult Compare(string firstFilename, string secondFilename, SKPixelComparerOptions? options)

Parameters

firstFilename string

The file path of the first image.

secondFilename string

The file path of the second image.

options SKPixelComparerOptions

Options controlling comparison behavior, such as whether to include the alpha channel. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKBitmap, SKBitmap, SKPixelComparerOptions?)

Compares two bitmaps pixel by pixel, using the specified comparison options.

public static SKPixelComparisonResult Compare(SKBitmap first, SKBitmap second, SKPixelComparerOptions? options)

Parameters

first SKBitmap

The first bitmap.

second SKBitmap

The second bitmap.

options SKPixelComparerOptions

Options controlling comparison behavior, such as whether to include the alpha channel. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKPixmap, SKPixmap, SKPixelComparerOptions?)

Compares two pixmaps pixel by pixel, using the specified comparison options.

public static SKPixelComparisonResult Compare(SKPixmap first, SKPixmap second, SKPixelComparerOptions? options)

Parameters

first SKPixmap

The first pixmap.

second SKPixmap

The second pixmap.

options SKPixelComparerOptions

Options controlling comparison behavior, such as whether to include the alpha channel. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKImage, SKImage, SKPixelComparerOptions?)

Compares two images pixel by pixel, using the specified comparison options. When CompareAlpha is true, the alpha channel is included in the comparison.

public static SKPixelComparisonResult Compare(SKImage first, SKImage second, SKPixelComparerOptions? options)

Parameters

first SKImage

The first image.

second SKImage

The second image.

options SKPixelComparerOptions

Options controlling comparison behavior, such as whether to include the alpha channel. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Exceptions

ArgumentNullException

first or second is null.

InvalidOperationException

The images have different dimensions.

Compare(string, string, string)

Compares two images loaded from file paths pixel by pixel, using a tolerance mask.

public static SKPixelComparisonResult Compare(string firstFilename, string secondFilename, string maskFilename)

Parameters

firstFilename string

The file path of the first image.

secondFilename string

The file path of the second image.

maskFilename string

The file path of the mask image defining per-channel tolerance thresholds.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKBitmap, SKBitmap, SKBitmap)

Compares two bitmaps pixel by pixel, using a tolerance mask.

public static SKPixelComparisonResult Compare(SKBitmap first, SKBitmap second, SKBitmap mask)

Parameters

first SKBitmap

The first bitmap.

second SKBitmap

The second bitmap.

mask SKBitmap

The mask bitmap defining per-channel tolerance thresholds.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKPixmap, SKPixmap, SKPixmap)

Compares two pixmaps pixel by pixel, using a tolerance mask.

public static SKPixelComparisonResult Compare(SKPixmap first, SKPixmap second, SKPixmap mask)

Parameters

first SKPixmap

The first pixmap.

second SKPixmap

The second pixmap.

mask SKPixmap

The mask pixmap defining per-channel tolerance thresholds.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKImage, SKImage, SKImage)

Compares two images pixel by pixel, using a tolerance mask. Pixel differences that fall within the mask's per-channel values are not counted as errors. Each channel is checked independently.

public static SKPixelComparisonResult Compare(SKImage first, SKImage second, SKImage mask)

Parameters

first SKImage

The first image.

second SKImage

The second image.

mask SKImage

The mask image defining per-channel tolerance thresholds.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Exceptions

ArgumentNullException

first, second, or mask is null.

InvalidOperationException

The images or mask have different dimensions.

Compare(string, string, string, SKPixelComparerOptions?)

Compares two images loaded from file paths pixel by pixel, using a tolerance mask and the specified comparison options.

public static SKPixelComparisonResult Compare(string firstFilename, string secondFilename, string maskFilename, SKPixelComparerOptions? options)

Parameters

firstFilename string

The file path of the first image.

secondFilename string

The file path of the second image.

maskFilename string

The file path of the mask image defining per-channel tolerance thresholds.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKBitmap, SKBitmap, SKBitmap, SKPixelComparerOptions?)

Compares two bitmaps pixel by pixel, using a tolerance mask and the specified comparison options.

public static SKPixelComparisonResult Compare(SKBitmap first, SKBitmap second, SKBitmap mask, SKPixelComparerOptions? options)

Parameters

first SKBitmap

The first bitmap.

second SKBitmap

The second bitmap.

mask SKBitmap

The mask bitmap defining per-channel tolerance thresholds.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKPixmap, SKPixmap, SKPixmap, SKPixelComparerOptions?)

Compares two pixmaps pixel by pixel, using a tolerance mask and the specified comparison options.

public static SKPixelComparisonResult Compare(SKPixmap first, SKPixmap second, SKPixmap mask, SKPixelComparerOptions? options)

Parameters

first SKPixmap

The first pixmap.

second SKPixmap

The second pixmap.

mask SKPixmap

The mask pixmap defining per-channel tolerance thresholds.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKImage, SKImage, SKImage, SKPixelComparerOptions?)

Compares two images pixel by pixel, using a tolerance mask and the specified comparison options. When TolerancePerChannel is true, each channel is checked independently against the corresponding mask channel value. When false, the sum of per-channel differences is checked against the sum of the mask's channel values. When CompareAlpha is true, the alpha channel is included in the comparison.

public static SKPixelComparisonResult Compare(SKImage first, SKImage second, SKImage mask, SKPixelComparerOptions? options)

Parameters

first SKImage

The first image.

second SKImage

The second image.

mask SKImage

The mask image defining per-channel tolerance thresholds.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Exceptions

ArgumentNullException

first, second, or mask is null.

InvalidOperationException

The images or mask have different dimensions.

Compare(string, string, int)

Compares two images loaded from file paths pixel by pixel, using a uniform per-pixel tolerance threshold. Pixels where the total per-channel difference (|ΔR| + |ΔG| + |ΔB|) is at or below the tolerance are not counted as errors.

public static SKPixelComparisonResult Compare(string firstFilename, string secondFilename, int tolerance)

Parameters

firstFilename string

The file path of the first image.

secondFilename string

The file path of the second image.

tolerance int

The maximum allowed sum of per-channel differences per pixel. Must be non-negative.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKBitmap, SKBitmap, int)

Compares two bitmaps pixel by pixel, using a uniform per-pixel tolerance threshold.

public static SKPixelComparisonResult Compare(SKBitmap first, SKBitmap second, int tolerance)

Parameters

first SKBitmap

The first bitmap.

second SKBitmap

The second bitmap.

tolerance int

The maximum allowed sum of per-channel differences per pixel. Must be non-negative.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKPixmap, SKPixmap, int)

Compares two pixmaps pixel by pixel, using a uniform per-pixel tolerance threshold.

public static SKPixelComparisonResult Compare(SKPixmap first, SKPixmap second, int tolerance)

Parameters

first SKPixmap

The first pixmap.

second SKPixmap

The second pixmap.

tolerance int

The maximum allowed sum of per-channel differences per pixel. Must be non-negative.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKImage, SKImage, int)

Compares two images pixel by pixel, using a uniform per-pixel tolerance threshold. Pixels where the total per-channel difference (|ΔR| + |ΔG| + |ΔB|) is at or below the tolerance are not counted as errors.

public static SKPixelComparisonResult Compare(SKImage first, SKImage second, int tolerance)

Parameters

first SKImage

The first image.

second SKImage

The second image.

tolerance int

The maximum allowed sum of per-channel differences per pixel. Must be non-negative.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Exceptions

ArgumentNullException

first or second is null.

ArgumentOutOfRangeException

tolerance is negative.

InvalidOperationException

The images have different dimensions.

Compare(string, string, int, SKPixelComparerOptions?)

Compares two images loaded from file paths pixel by pixel, using a uniform tolerance threshold and the specified comparison options.

public static SKPixelComparisonResult Compare(string firstFilename, string secondFilename, int tolerance, SKPixelComparerOptions? options)

Parameters

firstFilename string

The file path of the first image.

secondFilename string

The file path of the second image.

tolerance int

The maximum allowed per-channel or total per-pixel difference. Must be non-negative.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKBitmap, SKBitmap, int, SKPixelComparerOptions?)

Compares two bitmaps pixel by pixel, using a uniform tolerance threshold and the specified comparison options.

public static SKPixelComparisonResult Compare(SKBitmap first, SKBitmap second, int tolerance, SKPixelComparerOptions? options)

Parameters

first SKBitmap

The first bitmap.

second SKBitmap

The second bitmap.

tolerance int

The maximum allowed per-channel or total per-pixel difference. Must be non-negative.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKPixmap, SKPixmap, int, SKPixelComparerOptions?)

Compares two pixmaps pixel by pixel, using a uniform tolerance threshold and the specified comparison options.

public static SKPixelComparisonResult Compare(SKPixmap first, SKPixmap second, int tolerance, SKPixelComparerOptions? options)

Parameters

first SKPixmap

The first pixmap.

second SKPixmap

The second pixmap.

tolerance int

The maximum allowed per-channel or total per-pixel difference. Must be non-negative.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Compare(SKImage, SKImage, int, SKPixelComparerOptions?)

Compares two images pixel by pixel, using a uniform tolerance threshold and the specified comparison options. When TolerancePerChannel is true, each channel is checked independently against the tolerance value. When false, the sum of per-channel differences is checked against the tolerance. When CompareAlpha is true, the alpha channel is included in the comparison.

public static SKPixelComparisonResult Compare(SKImage first, SKImage second, int tolerance, SKPixelComparerOptions? options)

Parameters

first SKImage

The first image.

second SKImage

The second image.

tolerance int

The maximum allowed per-channel or total per-pixel difference. Must be non-negative.

options SKPixelComparerOptions

Options controlling comparison behavior via SKPixelComparerOptions. Pass null for default behavior.

Returns

SKPixelComparisonResult

An SKPixelComparisonResult containing the comparison statistics.

Exceptions

ArgumentNullException

first or second is null.

ArgumentOutOfRangeException

tolerance is negative.

InvalidOperationException

The images have different dimensions.