pegtop.net  >  delphi section  >  articles  >  blend modes  >  quadratic 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
 reflect mode
 Description: This mode is useful when adding shining objects or light zones to images. Michael Hansen introduced it to me, and gave it this name. The formula is similar to color dodge, but the result is not that bright in most cases. The result looks a bit like soft light. Formula: f(a,b) = a2 / (1 - b) Disadvantage: The formula can result in values greater than 1, so some truncation can occur (but not as extreme as for color dodge). Code: if b = 255 then result := 255 else begin c := a*a DIV (255-b); if c > 255 then result := 255 else result := c; end;
 glow mode
 Description: This mode is a variation of reflect mode (base and blend color swapped). I gave it this name because it is the "opposite" of reflect mode. The result looks a bit like hard light. Formula: f(a,b) = b2 / (1 - a) Disadvantage: The formula can result in values greater than 1, so some truncation can occur (but not as extreme as for inverse color dodge). Code: if a = 255 then result := 255 else begin c := b*b DIV (255-a); if c > 255 then result := 255 else result := c; end;
 freeze mode
 Description: Another variation of reflect mode (base and blend color inverted, the result inverted again). I'm seriously running out of names, but due to some examples I tried, I decided to take this name. Formula: f(a,b) = 1 - (1 - a)2 / b Disadvantage: The formula can result in values smaller than 0, so some truncation can occur (but not as extreme as for color burn). Code: if b = 0 then result := 0 else begin c := 255 - sqr(255-a) DIV b; if c < 0 then result := 0 else result := c; end;
 heat mode
 Description: Another variation of reflect mode (like freeze mode, but base and blend color swapped). I gave it this name because it is the "opposite" of freeze mode. Formula: f(a,b) = 1 - (1 - b)2 / a Disadvantage: The formula can result in values smaller than 0, so some truncation can occur (but not as extreme as for inverse color burn). Code: if a = 0 then result := 0 else begin c := 255 - sqr(255-b) DIV a; if c < 0 then result := 0 else result := c; end;
 index | previous page | next page