ImageEn, unit imageenproc

TImageEnProc.Intensity

TImageEnProc.Intensity


Declaration

procedure Intensity(LoLimit, HiLimit, Change: Integer; UseAverageRGB: Boolean; DoRed, DoGreen, DoBlue: Boolean);


Description

Change the value of a pixel by an amount determined by the input Red, Green and Blue channel RGB values individually, or as an averaged value. The change is graduated starting from LoLimit, with a maximum change applied to the midpoint between LoLimit and HiLimit, then reduced again to HiLimit.
Typically this method can be used to effectively progressively brighten or darken any range of colors as requested without affecting colors outside the range. RGB values in the range of 0 to 127 are considered as darker, and 128 to 255 as lighter.

Parameter Description
LoLimit The start point of the range (value between 0 and 255)
HiLimit The end point of the range (value between 0 and 255)
Change The maximum or minimum value to be applied to the midpoint, and used to determine the slope of the increment/decrement used over the range (value between -255 and 255)
UseAverageRGB If True, uses the average value of the input Red, Green and Blue channels to determine the amount to change all RGB channels of the pixel
DoRed, DoGreen, DoBlue If True, changes are applied to that RGB channel

Note: If the image PixelFormat is not ie24RGB, it will be converted


Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Examples

// Apply an Intensity gradient dropping to -24, to the Red RGB channel only, when Red values are between 20 and 127
ImageEnView1.Proc.Intensity( 20, 127, -24, False, True, False, False );


// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

  

// Apply an Intensity gradient peaking at +40 to all RGB values between 80 and 255
ImageEnView1.Proc.Intensity( 80, 255, 40, False, True, True, True );