8000 Single pixel diffs are not ignored · Issue #34 · gemini-testing/looks-same · GitHub
[go: up one dir, main page]

Skip to content

Single pixel diffs are not ignored #34

Open

Description

@jwir3

Using looks-same v3.3.0.

Note that the reference image was generated using WebGL on a Macbook Pro 2015, whereas the generated image is generated using a docker image running Ubuntu with osmesa.

looks-same configuration:

await looksSameAsync(actual, expected,
                                           {
                                             tolerance: tolerance,
                                             pixelRatio: self._getDPI(), // set to device DPI
                                             ignoreAntialiasing: true,
                                             ignoreCaret: true
                                           });

await looksSame.createDiffAsync({
        reference: this._getReferenceFilePath(),
        current: this.getActualFilePath(),
        diff: this._getDiffFilePath(),
        highlightColor: '#ff00ff',
        tolerance: tolerance,
        pixelRatio: self._getDPI(),
        ignoreAntialiasing: true,
        ignoreCaret: true
      });

reference image:
single-triangle-colors

generated image:
single-triangle-colors

diff:
single-triangle-colors

The lower left pixel of the triangle is showing up as different, and the test is failing due to this.

Activity

  1. KuznetsovRoman commented on Aug 18, 2025

    @KuznetsovRoman
    Member

    Hi. You can ignore these single-pixel diff in your own.

    I left a comment in the next PR on how to get count of different pixels: #33 (comment)

    You can implement custom check with these "differentPixels" and "totalPixels", returned with specified "createDiff: true"

    Does it solve your problem?

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

      0