Skip to content

CIFilter.labDeltaE outputs 255 for less than 2% difference in color #6

Description

@paulz

CIFilter.labDeltaE().outputImage shows 255 - max color difference:

image

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

image

Input images:

inputImage
https://github.com/paulz/ViewSnapshots/raw/main/AppTests/Snapshots/ToggleView-intel.png:
input image 1

image2
https://github.com/paulz/ViewSnapshots/raw/main/AppTests/Snapshots/ToggleView-m1.png
input image 2

Verified by test:

func testLargeDeltaEvenColorDifferenceIsLessThen2Percent() throws {
let delta = try calculateDelta("ToggleView")
XCTAssertEqual(areaMaximum(delta.delta), [255, 255, 255, 255])
let difference = try XCTUnwrap(diff(delta.first, delta.second).outputImage)
XCTAssertEqual(ImageComparisonResult(difference: difference).maxColorDifference(), 0.015625)
}

showing that CIFilter.differenceBlendMode is less than 1.5625%
while CIFilter.labDeltaE shows difference RGBA[255, 255, 255, 255]

Metadata

Metadata

Assignees

No one assigned

    Labels

    AppleApple Feedback issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions