donkirkby/live-py-plugin

Set tolerance by average difference

開放

#758 建立於 2026年2月9日

 (0 則留言) (0 個反應) (0 位負責人)Python (63 個分叉)auto 404
enhancementgood first issue

倉庫指標

星標
 (302 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南