Skip to main content

Image Resize

Resize images to fit within a specified pixel budget while maintaining aspect ratio.

What is Image Resize?

The Image Resize node automatically resizes images to fit within a specified pixel budget. It maintains the original aspect ratio while ensuring the total pixel count (width × height) doesn't exceed the configured limit. The output is converted to JPEG format for optimal file size.

How to use it?

Inputs

Pixel Budget (required)

  • The maximum total number of pixels allowed (width × height)
  • Default: 1,000,000 pixels (approximately 1000×1000)
  • Images exceeding this budget will be proportionally scaled down
  • Aspect ratio is always preserved

Image (required, input anchor)

  • The image file to be resized
  • Accepts standard image formats

Output

Image (output anchor)

  • The resized image file in JPEG format
  • Maintains original aspect ratio
  • Total pixels ≤ specified pixel budget

Example Use Cases

API Response Optimization

Reduce image sizes before sending through APIs:

  • Set pixel budget to 500,000 for fast transmission
  • Maintain visual quality while reducing file size
  • Convert to JPEG for universal compatibility

Image Processing Pipeline

Prepare images for AI models with specific input requirements:

  • Match model's expected input dimensions
  • Ensure consistent image sizes across batches
  • Reduce processing time and memory usage

Storage Optimization

Compress images before storing in databases or cloud storage:

  • Set appropriate pixel budget for your use case
  • Reduce storage costs
  • Maintain acceptable visual quality

How It Works

  1. Dimension Analysis: Calculates current image dimensions
  2. Budget Check: Compares total pixels against the specified budget
  3. Proportional Scaling: If needed, scales down while maintaining aspect ratio
  4. Format Conversion: Converts to JPEG format for optimal file size
  5. Output: Returns the resized image file

Best Practices

  • Choose Appropriate Budgets:

    • Thumbnails: 100,000-250,000 pixels (e.g., 500×500)
    • Standard web images: 500,000-1,000,000 pixels (e.g., 1000×1000)
    • High quality: 2,000,000-4,000,000 pixels (e.g., 2000×2000)
  • Consider Use Case: Set pixel budget based on downstream requirements (AI models, display size, storage constraints)

  • Pipeline Position: Place early in processing pipelines to reduce computational load for subsequent nodes

  • Format Awareness: Output is always JPEG - if you need PNG or other formats, use additional conversion nodes

Technical Details

  • Maintains aspect ratio during resize
  • Outputs in JPEG format
  • Efficient streaming-based processing
  • No resize performed if image already fits within budget