Image Resize

This function block changes the size of an incoming image. Use it to scale images up or down with selectable interpolation methods so downstream blocks receive images at the required dimensions.

πŸ“₯ Inputs

  • Image Any This is the image you want to resize.

  • Width Desired output width in pixels. Optional β€” leave empty to preserve the original width.

  • Height Desired output height in pixels. Optional β€” leave empty to preserve the original height.

πŸ“€ Outputs

  • Image Any The resized image.

πŸ•ΉοΈ Controls

  • Interpolation Method Choose how pixels are sampled when resizing. Common choices you will see: INTER_NEAREST, INTER_LINEAR, INTER_AREA, INTER_CUBIC, INTER_LANCZOS4.

    • Use INTER_AREA for downscaling (good for reducing aliasing).

    • Use INTER_LINEAR for general-purpose resizing (balanced speed and quality).

    • Use INTER_CUBIC or INTER_LANCZOS4 when upscaling and higher image quality is required (slower).

βš™οΈ How it runs

When this block runs it takes the provided Image Any and uses the chosen Interpolation Method to produce a new image at the requested Width and Height. If either dimension is left blank, that axis will keep the original image size. The resized image is sent to the output for the following blocks in the flow.

🎯 Key features

  • Precise control of output size using explicit width and height.

  • Multiple interpolation options so you can trade off speed and quality.

  • Works with any image-producing block and prepares images for models or visualization.

πŸ“ Usage tips

  • If you need to preview results, connect the output to Show Image.

  • Crop first then resize for best results when the region of interest is smaller than the full image. Use Image ROI or Slice Image before this block.

  • To avoid stretching and preserve aspect ratio, crop or pad the image first. Use Image Padding to add borders instead of distorting the image.

  • For models that expect smaller inputs (object detection, OCR), resize the image to the model’s preferred dimensions before feeding it to blocks like Object Detection (D-FINE), Object Detection - Custom, OCR, or OCR (EasyOCR).

πŸ’‘ Tips and Tricks

  • Preparing for OCR: enlarge a cropped text region with this block before connecting to OCR or OCR (EasyOCR) to improve recognition accuracy.

  • Preparing for detection: resize camera frames to a consistent size before Object Detection (D-FINE) or Object Detection - Custom so detection thresholds and box sizes behave predictably.

  • Preserve details when upscaling: when you must enlarge small images, pick INTER_CUBIC or INTER_LANCZOS4 for better visual quality.

  • Keep aspect ratio safe: to avoid distorted objects, use Image ROI or Image Padding to make the crop square (or match the model input) then resize.

  • Quick checks: attach Show Image right after this block to confirm the resized output visually.

πŸ› οΈ Troubleshooting

  • Blurry result after upscaling

    • Try a higher-quality interpolation such as INTER_CUBIC or INTER_LANCZOS4.

  • Important object appears squashed or stretched

    • Ensure aspect ratio is preserved. Crop or pad the image before resizing.

  • Unexpected size or orientation

    • Verify the numeric values provided to Width and Height and preview with Show Image.

    • If only one dimension should change, leave the other empty to keep the original size for that axis.

Last updated

Was this helpful?