What is the formula kCGBlendModeColorDodge

I use the "CGContextSetBlendMode" function in Quartz2D, but I do not understand the value of the constant "kCGBlendModeColorDodge". What is the kCGBlendModeColorDodge formula?

+3
source share
2 answers

Here is the formula for "color dodge":

// v1 and v2 are the RGBA pixel values for the two pixels 
// "on top of each other" being blended
void someFunction(v1,v2) {
    return Math.min(v1 + v2, 255);
}

Source of this page:

http://jswidget.com/blog/2011/03/11/image-blending-algorithmpart-ii/

Edit:

There are two evasion features. One is linear, the other is just a dodge. Here is a more detailed list of different blending modes:

How does Photoshop combine two images together?

The formula for the blending mode is confirmed on this page:

http://www.pegtop.net/delphi/articles/blendmodes/dodge.htm

... , :

http://www.simplefilter.de/en/basics/mixmods.html

, , , , "1" "255".

+1

:

// t_component range is [0...1]
t_component dodge_component(const t_component& a, const t_component& b) {
  // note: saturate and limit to range
  return a / (1.0 - b);
}

t_color dodge_color(const t_color& a, const t_color& b) {
  t_color result;
  for (each component in color_model) {
    result.component[i] = dodge_component(a.component[i], b.component[i]);
  }
  return result;
}
0

All Articles