Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Contrast Stretch

IP Command Grooper.IP

Adjusts the contrast of an image so that the lightest pixels become pure white and the darkest pixels become pure black.

Remarks

The Contrast Stretch command normalizes the contrast in an image by remapping the pixel intensity values so that the darkest pixels are set to 0 (black) and the lightest pixels are set to 255 (white). This process enhances the overall contrast, making details more visible and improving the visual quality of scanned or low-contrast images.

  • The black and white points are determined based on the image histogram and the configuration of the 'Black Threshold', 'Black Limit', and 'White Limit' properties.
  • This command is commonly used to correct images that appear washed out or faded, or to prepare images for further processing such as OCR or feature extraction.

DocumentDocument

Supported Pixel Formats

The Contrast Stretch command supports 8-bit grayscale and 24-bit RGB images. Other pixel formats are not modified.

Diagnostics

When diagnostic mode is enabled, Contrast Stretch generates before-and-after histogram images to help visualize the effect of the contrast adjustment. These diagnostics can be useful for tuning the command's parameters.

Usage Example

To stretch the contrast of a grayscale image while limiting the adjustment to the darkest 5% and lightest 5% of pixels, set 'Black Limit' and 'White Limit' to 0.05.

Properties

NameTypeDescription
General
Command Info

Used By

Notification