ComfyUI > Nodes > ComfyUI-MagickWand > ImageMagick Contrast Stretch

ComfyUI Node: ImageMagick Contrast Stretch

Class Name

ImageMagick Contrast Stretch

Category
MagickWand/Enhance
Author
Fannovel16 (Account age: 3129days)
Extension
ComfyUI-MagickWand
Latest Updated
2024-06-20
Github Stars
0.07K

How to Install ComfyUI-MagickWand

Install this extension via the ComfyUI Manager by searching for ComfyUI-MagickWand
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-MagickWand in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

ImageMagick Contrast Stretch Description

Enhance image contrast by adjusting intensity levels through stretching intensity range for improved visibility and detail enhancement.

ImageMagick Contrast Stretch:

The ImageMagick Contrast Stretch node is designed to enhance the contrast of an image by adjusting the intensity levels of the pixels. This process involves stretching the range of intensity values so that the darkest pixels become black and the brightest pixels become white, effectively increasing the overall contrast of the image. This technique is particularly useful for improving the visibility of details in images that appear washed out or have poor contrast. By specifying the black and white points, you can control the extent of the contrast enhancement, making it a versatile tool for various image enhancement tasks.

ImageMagick Contrast Stretch Input Parameters:

image

This parameter represents the input image that you want to apply the contrast stretch to. It accepts an image file in a supported format.

black_point

The black_point parameter defines the intensity level that will be mapped to black. Pixels with intensity values below this point will be set to black. The value ranges from 0.0 to 1024, with a default of 0.0. Adjusting this value can help in darkening the shadows and enhancing the contrast in darker regions of the image.

white_point

The white_point parameter specifies the intensity level that will be mapped to white. Pixels with intensity values above this point will be set to white. The value ranges from 0.0 to 1024, with a default of 0.0. Modifying this value can help in brightening the highlights and enhancing the contrast in lighter regions of the image.

channel

This parameter allows you to select the specific color channel to apply the contrast stretch to. Options include undefined, red, gray, cyan, green, magenta, blue, yellow, black, alpha, opacity, index, readmask, write_mask, meta, composite_channels, all_channels, true_alpha, rgb, rgb_channels, gray_channels, sync_channels, and default_channels. The default is red. Choosing the appropriate channel can help in targeting specific color components for contrast enhancement.

ImageMagick Contrast Stretch Output Parameters:

IMAGE

The output is the enhanced image with the applied contrast stretch. This image will have improved contrast, with darker shadows and brighter highlights, making details more visible and the overall image more visually appealing.

ImageMagick Contrast Stretch Usage Tips:

  • To achieve a balanced contrast enhancement, start with the default black_point and white_point values and gradually adjust them while observing the changes in the image.
  • Use the channel parameter to target specific color channels if you notice that certain colors in the image need more contrast enhancement than others.
  • For images with very low contrast, increasing the black_point and white_point values can significantly improve the visibility of details.

ImageMagick Contrast Stretch Common Errors and Solutions:

ValueError: Invalid black_point or white_point value

  • Explanation: This error occurs when the black_point or white_point values are set outside the allowed range of 0.0 to 1024. - Solution: Ensure that the black_point and white_point values are within the specified range and try again.

TypeError: Unsupported image format

  • Explanation: This error indicates that the input image is in a format that is not supported by the node.
  • Solution: Convert the image to a supported format (e.g., JPEG, PNG) and try again.

RuntimeError: Channel selection not applicable

  • Explanation: This error occurs when an invalid or unsupported channel is selected for the contrast stretch operation.
  • Solution: Verify that the selected channel is one of the supported options and try again.

ImageMagick Contrast Stretch Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-MagickWand
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.