-
Notifications
You must be signed in to change notification settings - Fork 1
Color Accuracy
Paul Zabelin edited this page Jul 3, 2022
·
2 revisions
Same View rendered on different machines might produce slightly different PNG images:
name | expected | actual | difference | max color difference |
---|---|---|---|---|
FavoriteView.1 | ![]() |
![]() |
![]() |
3.125 % |
FavoriteView.2 | ![]() |
![]() |
![]() |
4.6875 % |
This often cause snapshots tests to fail when comparing image files.
By using color accuracy we can ignore small difference and use same expected image on different machines.
Even when rendering images on iOS Simulator using CPU, Simulator is using GPU of the Mac to render views to images.
This cause small differences, like in above example Intel Mac produce 1.15% color difference from Apple Silicon Mac.
The same view rendered on a Virtual Mac produce up to 5% difference.