Comparison Tolerance

By default, Screenshotbot compares images pixel-to-pixel. Actually, we're even stricter than that: the file hashes has to be identical. This means that if EXIF data is different (e.g. timestamps), we'll mark them as different images.

In our experience, this generally works for most teams! If you think this isn't working for you, please reach out to us and we'll be able to provide you advice.

Pixel Tolerance

In some cases, in particular if you have less control over the CPU and GPU architecture of the machines rendering your images, you might have pixels that are very slightly off. You will typically see this in anti-aliasing, or in gradients. In Screenshotbot, the Metrics tool will show that the pixels are only slightly off.

In this case, pass --pixel-tolerance 1 when calling the Screenshotbot CLI. This tolerance is on a per-pixel level: if the pixel is within this distance we'll treat it as identical.

Be aware that adding this parameter will slow down reports on Pull Requests, since image processing is a lot slower than file hash comparison.

Threshold

The threshold is the percentage of pixels that need to be different in order to treat two images the same. This can be used in addition to Pixel Tolerance.

For example, you can pass --compare-threshold 0.001 to allow for 0.1% of the pixels to be different.

If you do use this, this number needs to be very slow. We highly recommend talking with our experts before choosing to use this parameter.

Ready to get started?

Sign up or contact us.