KJNodes/imagegenerated

Remap Image Range(RemapImageRange)

This node receives a tensor input of type IMAGE and internally performs a linear transformation calculation: `output = min + image * (max - min)`

Remap Image Range

image
IMAGE
min
0.00
max
1.00
clamp
KJNodes

The Remap Image Range node receives an IMAGE type tensor as input and internally performs a linear transformation calculation: output = min + image * (max - min).

The Remap Image Range node is an image processing tool whose core function is to remap the pixel value range of an input image. It allows users to linearly transform the original numerical range of an image to a custom minimum and maximum value, thereby adjusting the overall brightness and contrast of the image.

Node Function

This node receives an IMAGE type tensor as input and internally performs a linear transformation calculation: output = min + image * (max - min). If the clamp option is enabled, it restricts the output pixel values to the standard range of 0.0 to 1.0, ensuring the results comply with common image data specifications. The node supports floating-point precision calculations and can automatically handle conversions from half-precision (float16) to single-precision (float32) to ensure computational accuracy.

Node Parameter Description - Remap Image Range

Connection Inputs (Inputs)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
imageIMAGEYes--image (input parameter): The input image to be processed. The node will remap the pixel values of this image.

Control Parameters (Parameters)

Parameter NameData TypeRequiredDefault ValueValue Range/OptionsDescription
minFLOATYes0.0-10.0 - 1.0 (step: 0.01)min (input parameter): Sets the minimum value for the remapped range. The value range is -10.0 to 1.0, with a step size of 0.01.
maxFLOATYes1.00.0 - 10.0 (step: 0.01)max (input parameter): Sets the maximum value for the remapped range. The value range is 0.0 to 10.0, with a step size of 0.01.
clampBOOLEANYesTrue-clamp (input parameter): Controls whether to clamp the output image's pixel values between 0.0 and 1.0.

Output

Parameter NameData TypeDescription
IMAGEIMAGEIMAGE (output parameter): Outputs the image after pixel value remapping processing.

Usage Scenarios

This node is very useful in image preprocessing or post-adjustment workflows. For example, when an upstream node generates an image with insufficient dynamic range, this node can be used to expand the pixel values from a narrow range (e.g., 0.2-0.5) to a wider range (e.g., 0.0-1.0) to enhance the visual contrast of the image. It can also be used to normalize the results of high dynamic range (HDR) effects or to prepare data for subsequent nodes that require a specific input range.

The Remap Image Range node is from the ComfyUI-KJNodes node package.

Comments

Sign in with GitHub to join the discussion.

Loading comments…