Skip to content

Feature request: allow for small differences in cross-platform screenshot comparison #412

Open

Description

@bersbersbers

I usually generate expected test results on a Linux workstation, and tests are failing when run on a Mac due to fonts looking just a tiny bit different. I am aware of #291 being closed, but I wonder if some optional "fuzzy" (= more tolerant) screenshot comparison could be implemented to accept such minor differences.

Activity

  1. bersbersbers commented on Sep 16, 2021

    @bersbersbers
    Author

    I should add that vdiffr and gdiff do not seem to feature any such option, but there is https://github.com/MangoTheCat/visualTest at least.

    Also, ImageMagick seems to support this use case: https://stackoverflow.com/a/15682469/880783

    Edit: I seems I was expecting too much from the PAE - it returns "65535 (1)" for my case - I guess there is at least one pixel which has a black/white inversion. I guess we would need something that takes into account both changes in pixel intensity and distance to the nearest similar pixel, similar to the gamma index in radiotherapy: https://gi-yagit.readthedocs.io/en/latest/gamma_index.html

    Using such an index, a pixel in one images passes comparison if its intensity is very close (intensity-wise) to the intensity in the same pixel in the other image, or a pixel with similar intensity is very close (spatially) in the other image.

    Closely related: https://github.com/mapbox/pixelmatch, but I need a threshold of close to 1 to make all my pixels pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions