CIFilter.labDeltaE outputImage example shows 2 pixel difference:

the above image has dark gray background in preview of the actual image which has transparent background:
https://github.com/paulz/ViewSnapshots/blob/main/AppTests/Snapshots/ContentView-labDelta.png:

at CGPoint(x: 108, y: 28) CIFilter.labDeltaE shows difference RGBA[99, 99, 99, 99]
while CIFilter.labDeltaE().inputImage at that point has color: RGBA[79, 63, 0, 255]
and CIFilter.labDeltaE().image2 at that point has color: RGBA[79, 62, 0, 255]
Input images:
inputImage
https://github.com/paulz/ViewSnapshots/raw/main/AppTests/Snapshots/ContentView-intel.png:

image2
https://github.com/paulz/ViewSnapshots/raw/main/AppTests/Snapshots/ContentView-m1.png

Verified by test:
|
func testLargeDifferenceEvenWhenColorHasNoDifference() throws { |
|
let delta = try calculateDelta("ContentView") |
|
let maxDifference: [UInt8] = [99, 99, 99, 99] |
|
XCTAssertEqual(areaMaximum(delta.delta), maxDifference) |
|
let diffPoint = CGPoint(x: 108, y: 52 - 24) |
|
let maxColor = getColor(delta.delta, at: diffPoint) |
|
XCTAssertEqual(maxColor, maxDifference) |
|
|
|
let firstColor = getColor(delta.first, at: diffPoint) |
|
XCTAssertEqual(firstColor, [79, 63, 0, 255]) |
|
|
|
let secondColor = getColor(delta.second, at: diffPoint) |
|
XCTAssertEqual(secondColor, [79, 62, 0, 255]) |
|
|
|
let difference = try XCTUnwrap(diff(delta.first, delta.second).outputImage) |
|
XCTAssertEqual(ImageComparisonResult(difference: difference).maxColorDifference(), 0) |
|
} |
CIFilter.labDeltaEoutputImageexample shows 2 pixel difference:the above image has dark gray background in preview of the actual image which has transparent background:
https://github.com/paulz/ViewSnapshots/blob/main/AppTests/Snapshots/ContentView-labDelta.png:

at
CGPoint(x: 108, y: 28)CIFilter.labDeltaE shows differenceRGBA[99, 99, 99, 99]while
CIFilter.labDeltaE().inputImageat that point has color:RGBA[79, 63, 0, 255]and
CIFilter.labDeltaE().image2at that point has color:RGBA[79, 62, 0, 255]Input images:
inputImagehttps://github.com/paulz/ViewSnapshots/raw/main/AppTests/Snapshots/ContentView-intel.png:
image2https://github.com/paulz/ViewSnapshots/raw/main/AppTests/Snapshots/ContentView-m1.png
Verified by test:
ViewSnapshots/AppTests/PerceptualDifferencesTest.swift
Lines 74 to 90 in 37a518e