From f105ac50625039a7fdb982acf33e08104603e040 Mon Sep 17 00:00:00 2001 From: Patrick Morgan Date: Sun, 15 Dec 2024 21:21:49 -0800 Subject: [PATCH] WIP --- nodes/nodes.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nodes/nodes.py b/nodes/nodes.py index db6d75d..0c60ad4 100644 --- a/nodes/nodes.py +++ b/nodes/nodes.py @@ -350,7 +350,7 @@ class MaskContourProcessor: rr, cc, val = rr[mask], cc[mask], val[mask] # Apply line width and use white (1.0) value - canvas[rr, cc] = np.maximum(canvas[rr, cc], val * width) + canvas[rr, cc] += val * width # Change from np.maximum to addition # Render decorative elements if 'decorativeElements' in effect_data: @@ -369,10 +369,11 @@ class MaskContourProcessor: mask = (rr >= 0) & (rr < height) & (cc >= 0) & (cc < width) rr, cc, val = rr[mask], cc[mask], val[mask] - canvas[rr, cc] = np.maximum(canvas[rr, cc], val) + canvas[rr, cc] += val # Change from np.maximum to addition - # Combine with original mask using maximum value (white) - return np.maximum(mask_array, canvas) + # Combine with original mask using addition and clip to valid range + combined_mask = np.clip(mask_array + canvas, 0, 1) + return combined_mask def process_mask(self, mask, line_length, line_count, line_width): """Process a mask by adding flame-like contour effects.