Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight different pixels #108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

navartis
Copy link

When perPixelTolerance == 0 is used library sometimes produce not representable diffs(example)

It happens because of used kCGBlendModeDifference for generating diff images and it's implementation are not very precise.

For such situations I implemented highlightDifferentPixels property of FBSnapshotTestCase which when is true acitivate producing of diff image with highlighted pixels (example).

class AnyTestCase: FBSnapshotTestCase {
    override func setUp() {
        super.setUp()

        recordMode = false
        highlightDifferentPixels = true
    }
}

Diffed Image_3_72E6C59B-DBF7-432D-84D3-5F9270F32F13

Failed Image_2_72E6C59B-DBF7-432D-84D3-5F9270F32F13

Reference Image_1_72E6C59B-DBF7-432D-84D3-5F9270F32F13

Diffed Image vs Highlighted Pixels

@CLAassistant
Copy link

CLAassistant commented Oct 29, 2019

CLA assistant check
All committers have signed the CLA.

@navartis
Copy link
Author

navartis commented May 7, 2020

@reidmain Hi

@nngenov
Copy link

nngenov commented Mar 24, 2021

@alanzeino Ping

@alanzeino
Copy link
Collaborator

Why are you pinging me?

@nngenov
Copy link

nngenov commented Mar 24, 2021

@alanzeino Well, as I saw, you are/were contributor to the project, and this seemed really useful as functionality and it seemed to be without any resolution for quite some time now, so can someone merge that if they deem it useful for the project ?

@417-72KI
Copy link
Contributor

Any updates?
I'm looking forward to this wonderful feature.

@alanzeino
Copy link
Collaborator

Any updates?
I'm looking forward to this wonderful feature.

Use :commit feature if you're using Cocoapods and use the fork?

Now that I'm back maintaining this I'm not sure we would even take it, considering it clashes with the percentage based tolerance, seems odd to have two ways to set tolerance on image diffing. At the very least we could produce better diff images which would resolve "... generating diff images and it's implementation are not very precise".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants