Skip to content

Commit

Permalink
RESIZE_MATTE option updated to allow transparent mattes
Browse files Browse the repository at this point in the history
  • Loading branch information
Amorano committed Feb 6, 2025
1 parent 83fb0cc commit f306bbc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ You can colorize nodes via their `title background`, `node body` or `title text`

## UPDATES

**2024/02/06** @1.7.06:
* `RESIZE_MATTE` option updated to allow transparent mattes

**2024/02/06** @1.7.05:
* updated `QUEUE` and `QUEUE TOO` progress while loading all images as "batch"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "jovimetrix"
description = "Integrates Webcam, MIDI, Spout and GLSL shader support. 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 = "1.7.05"
version = "1.7.06"
license = { file = "LICENSE" }
readme = "README.md"
authors = [{ name = "Alexander G. Morano", email = "[email protected]" }]
Expand Down
9 changes: 7 additions & 2 deletions sup/image/adjust.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
image_convert, image_mask_add, image_matte, image_minmax, bgr2image, \
cv2tensor, image2bgr, tensor2cv

from .compose import image_crop_center
from .compose import image_blend, image_crop_center

from .channel import EnumPixelSwizzle, \
channel_solid
Expand Down Expand Up @@ -367,9 +367,14 @@ def image_scalefit(image: TYPE_IMAGE, width: int, height:int,
matte:TYPE_PIXEL=(0,0,0,0)) -> TYPE_IMAGE:

match mode:
case EnumScaleMode.MATTE | EnumScaleMode.RESIZE_MATTE:
case EnumScaleMode.MATTE:
image = image_matte(image, matte, width, height)

case EnumScaleMode.RESIZE_MATTE:
canvas = np.full((height, width, 4), matte, dtype=image.dtype)
image = image_blend(canvas, image)
#image = image_matte(image, matte, width, height)

case EnumScaleMode.ASPECT:
h, w = image.shape[:2]
ratio = max(width, height) / max(w, h)
Expand Down

0 comments on commit f306bbc

Please sign in to comment.