Hades logoHades applet banner
Color saturation

applet icon

The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences. To start the applet, please enable Java and reload this page. (You might have to restart the browser.)

Circuit 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;

Print version | Run this demo in the Hades editor (via Java WebStart)
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)
Impressum http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/00-intro/02-imageprocessing/saturation.html