Skip to main content

Normalize Image

Controlled node

Overview

The Normalize Image node adjusts the color levels of an image to enhance visibility and contrast. It stretches the image's histogram to cover the full range of brightness values (0-255), making dark areas darker and bright areas brighter. This is particularly useful for improving the visual quality of images with poor lighting or low contrast.

This node uses the Jimp image processing library under the hood and applies a standard normalization algorithm to redistribute pixel values across the full color spectrum.

Inputs

InputTypeDescriptionDefault
RunEventFires when the node starts processing the image.-
ImageDataThe input image object to be normalized. Accepts Jimp image instances.-

Outputs

OutputTypeDescription
DoneEventFires when the image normalization is complete.
OutputDataThe normalized image with enhanced contrast and visibility.

Runtime Behavior

When triggered by the Run event, the node clones the input image and applies color normalization. The normalization process remaps the pixel values so that the darkest pixel becomes pure black (0) and the brightest pixel becomes pure white (255), with all other pixels redistributed proportionally between these values.

The node does not modify the original image; instead, it outputs a new processed image instance. If the input is not a valid Jimp image instance, the output will be null.

Example Usage

Basic Image Enhancement

Connect an image source (such as a Read Image node or AI Generate Image node) to the Image input, then trigger the Run event to normalize the colors:

  1. Load an image using the Read Image node
  2. Connect the image output to the Normalize Image node's Image input
  3. Connect a trigger event (like Start) to the Run input
  4. Use the Output from Normalize Image for further processing or save it with Write To Library

This workflow is useful for:

  • Preparing low-contrast images for OCR processing
  • Enhancing visibility of scanned documents
  • Standardizing image brightness before computer vision tasks
  • Improving the visual quality of generated images