Skip to content

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 expected 1 actual1 diff 1 3.125 %
FavoriteView.2 expected 2 actual2 diff 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.

Simulator Graphics Card

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.

Clone this wiki locally