Hades logo    Hades applet banner

TAMS / Java / Hades / applets (print version): contents | previous | next

Color saturation

Color saturation screenshot

Description

A demonstration of color saturation manipulation using the SaturationFilter component.

The saturation filter uses one parameter s to specify the output image color saturation. The parameter value ranges from 0.0 (grayscale) via 1.0 (original colors) to 2.0 (full saturation).

  double RW = 0.3086; // or 0.299 for YIV values
  double RG = 0.6084; // or 0.587 for YIV values
  double RB = 0.0820; // or 0.114 for YIV values

  a = (1 - s) * RW + s;
  b = (1 - s) * RW;
  c = (1 - s) * RW;
  d = (1 - s) * RG;
  e = (1 - s) * RG + s;
  f = (1 - s) * RG;
  g = (1 - s) * RB;
  h = (1 - s) * RB;
  i = (1 - s) * RB + s;

  output_red   = a*red + d*green + g*blue;
  output_green = b*red + e*green + h*blue;
  output_blue  = c*red + f*green + i*blue;
  output_alpha = alpha;

Run the applet | Run the editor (via Webstart)


Impressum | 24.11.06
http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/00-intro/02-imageprocessing/saturation_print.html