Class: PixelDiffer
mugshot.PixelDiffer
Compare screenshots pixel by pixel using pixelmatch.
Images with different dimensions will always fail comparison and a diff indicating the extra region will be returned. The images will be overlaid starting from the top left corner and then compared. All of the pixels that are outside of the intersection will be considered different, no matter the threshold.
See the examples below to understand how images with different sizes will be compared.
#
Implements#
Constructors#
constructor+ new PixelDiffer(__namedParameters?
: PixelDifferOptions): PixelDiffer
#
Parameters:Name | Type | Default value | Description |
---|---|---|---|
__namedParameters | PixelDifferOptions | {} | PixelDifferOptions |
Returns: PixelDiffer
Defined in: packages/mugshot/src/lib/pixel-differ.ts:54
#
Methods#
compare▸ compare(expected
: Buffer, actual
: Buffer): Promise<DiffResult>
#
Parameters:Name | Type |
---|---|
expected | Buffer |
actual | Buffer |
Returns: Promise<DiffResult>
Implementation of: PNGDiffer.compare
Defined in: packages/mugshot/src/lib/pixel-differ.ts:67