EasyUse/Imagegenerated

imageCropFromMask

The imageCropFromMask node crops an input image and mask to the bounding box of the mask, then outputs the cropped image, cropped mask, and the bounding box coo...

image Crop From Mask

image
mask
crop_image
crop_mask
bbox
image_crop_multi
1.000
mask_crop_multi
1.000
bbox_smooth_alpha
1.00
Easy Use

The imageCropFromMask node crops an input image and mask to the bounding box of the mask, then outputs the cropped image, cropped mask, and the bounding box coordinates. It is grouped under EasyUse/Image and is useful for isolating a masked subject for further processing or compositing.

Inputs

  • image (IMAGE, required)
    The full-resolution input image to crop.

  • mask (MASK, required)
    The mask used to determine the crop region. The node crops to the bounding box enclosing the mask area.

  • image_crop_multi (FLOAT, required)
    Multiplier applied to the mask bounding box when cropping the image.
    Default: 1 · Min: 0 · Max: 10 · Step: 0.001

    A value of 1 crops the image exactly to the mask bounding box. Larger values expand the crop to include surrounding context; smaller values shrink it.

  • mask_crop_multi (FLOAT, required)
    Multiplier applied to the mask bounding box when cropping the mask.
    Default: 1 · Min: 0 · Max: 10 · Step: 0.001

    This works independently from image_crop_multi, so the image and mask outputs can use different crop sizes.

  • bbox_smooth_alpha (FLOAT, required)
    Smoothing factor for the bounding box across frames.
    Default: 1 · Min: 0 · Max: 1 · Step: 0.01

    A value of 1 uses the current frame's bounding box directly. Lower values blend the current bounding box with previous ones, which can reduce jitter in image sequences or animations.

Outputs

  • IMAGE
    The input image cropped to the mask bounding box, with image_crop_multi applied to the crop size.

  • MASK
    The input mask cropped to the mask bounding box, with mask_crop_multi applied to the crop size.

  • BBOX
    The bounding box coordinates used for the crop. This can be passed to other nodes that expect a BBOX value.

Usage Notes

  • All inputs are required.
  • image_crop_multi and mask_crop_multi are independent, so you can create a relaxed image crop with extra context while keeping the mask output tight to the original mask, or vice versa.
  • If the two multipliers differ, the output image and output mask may have different dimensions.
  • bbox_smooth_alpha is especially useful when processing image sequences where the mask bounding box changes rapidly between frames.

Comments

Sign in with GitHub to join the discussion.

Loading comments…