PEGTOP  >  delphi section  >  articles  >  blend modes  >  interpolation mode 

 delphi section 

 blend modes 
 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 
 dark modes 
 bright modes 
 final words 


 about me 

interpolation mode
This mode somehow combines multiply and screen mode (looks very similar for very dark or bright colors). A cosine function is used for calculation, similar to a cosine interpolation algorithm (that's why I gave it this name). This result is similar to average mode, but has a better contrast.

f(a,b) = ½ - ¼cos(pi*a) - ¼cos(pi*b)

This mode is commutative (base and blend color can be swapped).


It is useful to precalculate a cosine table to increase speed. Note that the result can become greater than 255. This is avoidable by using a factor of 63 instead of 64, but this way you cannot reach 0 and 255 with one formula.
index | previous page | next page
© Copyright 2006 by PEGTOP Software