ImageEn, unit imageenproc |
|
TImageEnProc.IntensityRGBAll
Declaration
procedure IntensityRGBAll(R, G, B: Integer);
Description
Adjust the RGB channels of the current image or the selected region.
R, G and B are the channel offsets, from -255 to +255.
Negative values darken all the pixels in the image. Positive values lighten all pixels in the image. To darken colors use IntensityRGBAll (-10, -10, -10). To lighten colors use IntensityRGBAll (10, 10, 10).
Also see
AdjustBrightnessContrastSaturation which uses a non-linear LUT to adjust the pixel colors. IntensityRGBAll adjusts the pixel colors by adding or subtracting the R, G, B values of each pixel in the image.
Note:
◼A UI for this is available to your users in the
Image Processing dialog
◼Also available as a
RetouchTool by setting
MouseInteractGeneral to [miRetouchTool] and
RetouchMode to iermBrightness
◼If the image
PixelFormat is not ie24RGB or ie32RGB, it will be converted
| Demos\ImageEditing\EveryMethod\EveryMethod.dpr |
Alternative Methods
There are multiple methods that will be adjust the brightness (luminosity) of an image:
◼TImageEnProc.IntensityRGBAll:
ImageEnView1.Proc.IntensityRGBall(20, 20, 20); // Increase luminosity by 20 (the fastest)
◼AdjustBrightnessContrastSaturation:
ImageEnView1.Proc.AdjustBrightnessContrastSaturation(20, 0, 0); // Increase luminosity by 20
◼HSLvar:
ImageEnView1.Proc.HSLvar(0, 0, 20); // Increase luminosity of by (slow but more accurate)
◼HSVvar:
ImageEnView1.Proc.HSVvar(0, 0, 20); // Increase luminosity of by (slow but more accurate)
// Remove the Red channel
ImageEnView1.Proc.IntensityRGBAll( -255, 0, 0 );
// Apply a Red filter (subtracts the Green and Blue channels)
ImageEnView1.Proc.IntensityRGBAll( 0, -255, -255 );
// Apply a darken filter (subtracts the same value from all channels)
ImageEnView1.Proc.IntensityRGBAll( -10, -10, -10 );
// Apply a lighten filter (adds the same value to all channels)
ImageEnView1.Proc.IntensityRGBAll( 10, 10, 10 );
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );
// Adjust the RGB channel
ImageEnView1.Proc.IntensityRGBAll( 5, 10, 15 );