   pegtop.net  >  delphi section  >  articles  >  blend modes  >  additive modes delphi section  articles  blend modes  introduction  normal mode  average mode  multiply mode  screen mode  darken mode  lighten mode  difference modes  overlay mode  hard light mode  soft light mode  dodge modes  burn modes  quadratic modes  additive modes  interpolation mode  logical modes  RGB modes  HSL modes  opacity  dark modes  bright modes  final words  components  about me  additive mode  Description: A very basic blend mode. Formula: f(a,b) = a + b Advantage: This mode is commutative (base and blend color can be swapped). Disadvantage: The formula can result in values greater than 1, so some truncation can occur. Code: c := a+b; if c > 255 then result := 255 else result := c; subtractive mode  Description: The "opposite" of additive mode. In fact the same as additive mode, but darker - dark colors are truncated instead of bright colors (the "real opposite" would be a - b, what can be done by inverting the blend image). Formula: f(a,b) = a + b - 1 Advantage: This mode is commutative (base and blend color can be swapped). Disadvantage: The formula can result in values smaller than 0, so some truncation can occur. Code: c := a+b-256; if c < 0 then result := 0 else result := c; stamp mode  Description: This mode somehow is similar to average mode. It is helpful when applying relief or bump textures to images (that's why I gave it this name). Gray blend colors do not change the background, brighter or darker colors make the background brighter or darker. The result can become very extreme, so this mode works best with medium colors. Formula: f(a,b) = a + 2b - 1 Disadvantage: The formula can result in values smaller than 0 or greater than 1, so some truncation can occur. Code: c := a + 2*b - 256; if c < 0 then result := 0 else if c > 255 then result := 255 else result := c;
 index | previous page | next page © Copyright 2006 by PEGTOP Software 