donkirkby/live-py-plugin

Set tolerance by average difference

Open

#758 opened on Feb 9, 2026

 (0 comments) (0 reactions) (0 assignees)Python (63 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (302 stars)
PR merge metrics
 (PR metrics pending)

Description

What I did

When you use the LiveImageDiffer, particularly with text in images, the images are sometimes a little unpredictable. For example, antialiasing can make random changes to the text pixels.

What happened

You can use the tolerance attribute to allow some difference, but the pattern is usually a small number of pixels with a significant difference, and most pixels with no difference. Tolerating difference in the text pixels could mask differences in a lot of other pixels, elsewhere in the image.

What could happen

Matplotlib's check_figures_equal() takes a tolerance paramter, but compares it to the root mean square of the colour difference of all pixels in the image. We could either add another tolerance attribute or switch what the current one means. Probably better to add a new one, instead of breaking some old tests.

Contributor guide