Respect excluded regions in overlay rendering

This commit is contained in:
lm 2025-10-19 21:09:26 +02:00
parent 0fd527cd78
commit 6de4059291
1 changed files with 6 additions and 5 deletions

View File

@ -154,19 +154,20 @@ class QtImageProcessor:
r, g, b, a = pixels[x, y]
if a == 0:
continue
match = self._matches(r, g, b)
excluded = bool(mask_px and mask_px[x, y])
total_all += 1
if self._matches(r, g, b):
draw.point((x, y), fill=highlight)
matches_all += 1
if excluded:
total_excl += 1
if self._matches(r, g, b):
if match:
matches_excl += 1
else:
total_keep += 1
if self._matches(r, g, b):
if match:
draw.point((x, y), fill=highlight)
matches_keep += 1
if match:
matches_all += 1
self.overlay_img = overlay
self.stats = Stats(