Skip to content

Novis\Image\Comparison

The result of Image::compare. A delta is the largest difference in one channel, from 0 to 255. ssim is 1.0 for identical images. differenceImage is a PNG with the differing pixels in red, or null.

Returned by

You get a Novis\Image\Comparison from these methods:

Members

1 member.

MemberSignature
constructorconstructor(bool $identical, uint $differingPixels, uint $maxDelta, float $ssim, ?bytes $differenceImage): void

Properties

  • $comparison->identicalbooltrue when every pixel of the two images is the same
  • $comparison->differingPixelsuintthe number of pixels with a delta above tolerance
  • $comparison->maxDeltauintthe largest difference in one channel, from 0 to 255
  • $comparison->ssimfloatthe structural similarity of the two images, 1.0 for identical images
  • $comparison->differenceImage?bytesa PNG image with the differing pixels in red, or null. Image::compare draws it only with the option render: true.