SHAPE NODE fixed for transparency blends when using blurred masks
This commit is contained in:
@@ -138,7 +138,10 @@ Nodes that have been migrated:
|
||||
|
||||
[Migrated to Jovi_GLSL](https://github.com/Amorano/Jovi_GLSL)
|
||||
|
||||
**2025/04/23** @2.0.9:
|
||||
**2025/04/24** @2.0.10:
|
||||
* `SHAPE NODE` fixed for transparency blends when using blurred masks
|
||||
|
||||
**2025/04/24** @2.0.9:
|
||||
* removed inversion in pixel splitter
|
||||
|
||||
**2025/04/23** @2.0.8:
|
||||
@@ -181,33 +184,6 @@ Nodes that have been migrated:
|
||||
* removed array and no one even noticed.
|
||||
* all inputs should be treated as a list even single elements []
|
||||
|
||||
|
||||
**2025/03/28** @1.7.46:
|
||||
* ~~updated requirements for numpy to only be >=1.26.4~~
|
||||
* removed to keep numba working with numpy < 2.0
|
||||
|
||||
**2025/03/25** @1.7.45:
|
||||
* no work around comfyui not doing type conversion past version 1.10.14
|
||||
|
||||
**2025/03/18** @1.7.42:
|
||||
* updated numby jit to ignore python objects
|
||||
* aligned float("NaN") constructs
|
||||
|
||||
**2025/03/18** @1.7.40:
|
||||
* allow vectors to be inline inputs + widget cause waiting for ComfyUI team is painful
|
||||
* changed precision default to 3
|
||||
* merged new action trigger from ComfyUI team
|
||||
|
||||
**2025/03/06** @1.7.34:
|
||||
* prep for Purz stream
|
||||
* removed security scanner failures for in-line http links
|
||||
* auto-size masks during mask add
|
||||
* fix some limits on transform node
|
||||
* better constraints for UNARY and BINARY OP nodes
|
||||
* fix inversion in pixel merge
|
||||
* defaults for regex colorizer entries
|
||||
* fall through for constant node input
|
||||
|
||||
<div align="center">
|
||||
<img src="https://github.com/user-attachments/assets/8ed13e6a-218c-468a-a480-53ab55b04d21" alt="explicit vector node supports" width="640"/>
|
||||
<img src="https://github.com/user-attachments/assets/4459855c-c4e6-4739-811e-a6c90aa5a90c" alt="TICK Node Batch Support Output" width="384"/>
|
||||
|
||||
+17
-13
@@ -34,7 +34,8 @@ from ..sup.image.channel import \
|
||||
|
||||
from ..sup.image.compose import \
|
||||
EnumShapes, \
|
||||
shape_ellipse, shape_polygon, shape_quad, image_mask_binary, image_stereogram
|
||||
image_blend, shape_ellipse, shape_polygon, shape_quad, image_mask_binary, \
|
||||
image_stereogram
|
||||
|
||||
from ..sup.image.adjust import \
|
||||
EnumEdge, EnumScaleMode, EnumInterpolation, \
|
||||
@@ -149,30 +150,33 @@ Create n-sided polygons. These shapes can be customized by adjusting parameters
|
||||
width, height = wihi
|
||||
sizeX, sizeY = size
|
||||
fill = color[:3][::-1]
|
||||
back = matte[:3][::-1]
|
||||
|
||||
match shape:
|
||||
case EnumShapes.RECTANGLE | EnumShapes.SQUARE:
|
||||
pA = shape_quad(width, height, sizeX, sizeY, fill, back)
|
||||
rgb = shape_quad(width, height, sizeX, sizeY, fill)
|
||||
|
||||
case EnumShapes.ELLIPSE | EnumShapes.CIRCLE:
|
||||
pA = shape_ellipse(width, height, sizeX, sizeY, fill, back)
|
||||
rgb = shape_ellipse(width, height, sizeX, sizeY, fill)
|
||||
|
||||
case EnumShapes.POLYGON:
|
||||
pA = shape_polygon(width, height, sizeX, sides, fill, back)
|
||||
rgb = shape_polygon(width, height, sizeX, sides, fill)
|
||||
|
||||
rgb = pil_to_cv(rgb)
|
||||
rgb = image_transform(rgb, offset, angle, edge=edge)
|
||||
mask = image_mask_binary(rgb)
|
||||
|
||||
pA = pil_to_cv(pA)
|
||||
pA = image_transform(pA, offset, angle, edge=edge)
|
||||
if blur > 0:
|
||||
# @TODO: Do blur on larger canvas to remove wrap bleed.
|
||||
pA = (gaussian(pA, sigma=blur, channel_axis=2) * 255).astype(np.uint8)
|
||||
rgb = (gaussian(rgb, sigma=blur, channel_axis=2) * 255).astype(np.uint8)
|
||||
mask = (gaussian(mask, sigma=blur, channel_axis=2) * 255).astype(np.uint8)
|
||||
|
||||
pA = image_matte(pA, matte)
|
||||
mask = image_mask_binary(pA)
|
||||
pB = image_mask_add(pA, mask)
|
||||
matte = image_matte(pB, matte)
|
||||
back = list(matte[:3]) + [255]
|
||||
canvas = np.full((height, width, 4), back, dtype=rgb.dtype)
|
||||
rgba = image_blend(canvas, rgb, mask)
|
||||
rgba = image_mask_add(rgba, mask)
|
||||
rgb = image_convert(rgba, 3)
|
||||
|
||||
images.append([cv_to_tensor(pB), cv_to_tensor(matte), cv_to_tensor(mask, True)])
|
||||
images.append([cv_to_tensor(rgba), cv_to_tensor(rgb), cv_to_tensor(mask, True)])
|
||||
pbar.update_absolute(idx)
|
||||
return image_stack(images)
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "jovimetrix"
|
||||
description = "Animation via tick. Parameter manipulation with wave generator. Math operations with Unary and Binary support. Value conversion for all major types (int, string, list, dict, Image, Mask). Shape mask generation, image stacking and channel ops, batch splitting, merging and randomizing, load images and video from anywhere, dynamic bus routing with a single node, export support for GIPHY, save output anywhere! flatten, crop, transform; check colorblindness, make stereogram or stereoscopic images, or liner interpolate values and more."
|
||||
version = "2.0.9"
|
||||
version = "2.0.10"
|
||||
license = { file = "LICENSE" }
|
||||
readme = "README.md"
|
||||
authors = [{ name = "Alexander G. Morano", email = "amorano@gmail.com" }]
|
||||
|
||||
Reference in New Issue
Block a user