Image Padding
This function block adds a constant-color border (padding) around an image. Use it to create margins, unify image sizes, or prepare images for concatenation and layout tasks without altering the original content.
π₯ Inputs
Input Image The image to which padding will be applied.
Padding Size A number specifying how many pixels to add (applied according to the chosen side).
Color A pixel color value (B, G, R) used as the padding fill color. If not provided, black is used.
π€ Outputs
Padded Image The resulting image with the added padding.
πΉοΈ Controls
Padding Side Choose which side(s) the padding should be applied to. Available options
ALLVERTICALHORIZONTALLEFTRIGHTTOPBOTTOM
This control determines where the padding pixels are added relative to the input image.
π¨ Features
Fixed-color border applied anywhere around the image.
Flexible side selection to pad only needed edges.
Accepts a pixel color input so you can match backgrounds or highlight margins.
π Usage Instructions
Provide an image to
Input Image.Enter the number of pixels in
Padding Sizeto define the border width.Optionally feed a color into
Color(format: (Blue, Green, Red)). If left empty, the padding will be black.Select the desired side with
Padding Sideand run the scenario to getPadded Image.
π Evaluation
When executed, this block returns the image with the padding applied according to the chosen side, size, and color. Use the output directly in downstream visualization or processing blocks.
π‘ Tips and Tricks
To make multiple images the same canvas size for visual comparison, first use
Image Resizeto match heights or widths, then use this block to add symmetric padding so all images align visually.If you want to focus on a cropped region and then add a background, combine
Image ROI Select(to crop) β this block (to add border) βShow Imageto preview the result.To create margins before combining images side-by-side, add padding and then use
Image ConcatenateorCollage Imagesto assemble a clean layout.Use
Make Imageto create a colored background and then use this block when you need extra margins that match a specific background color.Save padded results automatically by connecting
Padded ImagetoImage LoggerorImage Write.
(hint) When providing color, remember the system expects pixel values in BGR order.
π οΈ Troubleshooting
If the padding appears in an unexpected color, confirm the
Colorinput is provided as (Blue, Green, Red) and values are within 0β255.If no change is visible, ensure
Padding Sizeis greater than zero and that the correctPadding Sideoption is selected.When combining many images after padding, check final alignment with
Show Imageto verify spacing and border consistency.
Last updated
Was this helpful?