ImageEn, unit imageenproc

TImageEnProc.AdjustBrightnessContrastSaturation

TImageEnProc.AdjustBrightnessContrastSaturation


Declaration

procedure AdjustBrightnessContrastSaturation(Brightness, Contrast, Saturation: Integer);


Description

Adjust brightness, contrast and color saturation in a single step.

Parameter Description
Brightness A value between -100 and 100
Contrast A value between -100 and 100
Saturation A value between 0 and 512

Note:
Set a parameter to zero, to avoid changing that value.
If the image PixelFormat is not ie24RGB, it will be converted


Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Alternative Methods

There are multiple methods that will be adjust the brightness (luminosity) of an image:
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)


Example

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

  

// Enhance brightness, contrast and color saturation
ImageEnView1.Proc.AdjustBrightnessContrastSaturation( 50, 10, 10 );

  


// Enhance only brightness and contrast, maintain existing color saturation
ImageEnView1.Proc.AdjustBrightnessContrastSaturation( 50, 10, 0 );