Skip to content

Improved difference image to better show subtle differences. #514

@CraigSiemens

Description

@CraigSiemens

Would it be possible to normalize the difference image that's created when a snapshot fails? That way if a snapshot only has really subtle differences, they can still be seen in the difference image.


We're updating our app to build with Xcode12 and iOS 15. A bunch if our image snapshot tests have started failing, presumably due to rendering differences between iOS 14 and 15. When we look at the difference image that generated, they look blank.

This is an extreme example, but does show it off.

If I take the image, open in preview > adjust colors > auto levels, it brightens up the areas of the image that are different.

This is cropped to show the important part.
difference_3_DDFA5885-E945-494C-A9CA-AE69DD64940E copy

It'd be nice if the output image could be normalized to brighten up those ares without needing to use another tool.


Another option could be to do something like the compare command from ImageMagick which shows a faded out version of the reference image, then colors in red any part that is different.

This is from running
compare reference.png failure.png output.png

output.png

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