<p>In general, notice that there is no particular reason for a blend mode or other color processing formula <em>in an image manipulation program</em> to be reasonable “from first principles” at all. All we care about is that, empirically, it produces an artistically useful result.</p>
<p>That said, we can make some useful observations about the structure of this particular operation:</p>
<ol>
<li><p>By inverting a color (that is, subtracting each component from 1), we can think of the resulting numbers as being “distance from white” in the same way that regular color components are “distance from black”. This preserves all the original information, but represents it differently.</p>
</li>
<li><p>If you invert twice, you get the same color back. So, overall, the two inversions don't change the color; if we <em>didn't</em> do something in the middle, the overall operation would do nothing.</p>
</li>
<li><p>Thus, we can think of the operation in the middle, the division as “operating in distance-from-white space”. By dividing by a number less than 1 (the value from the top layer), we scale up the distance-from-white of the color — darkening it.</p>
</li>
</ol>
<p>Notice also that the “burn” in the name <a href="https://en.wikipedia.org/wiki/Dodging_and_burning" rel="nofollow noreferrer">comes from film photography</a>. The ordinary process of developing photographs inverts color twice (which is why the developed “negative” film is called that and looks the way it does), and dodging and burning were about manipulating the intensity of the light that fell on the print after passing through the negative. Thus, the digital/mathematical emulation of the technique also involves two inversions and a scaling, performed by optical and chemical processes.</p>

CC BY-SA 4.0
2023-08-17T15:12:30.497Z
2023-08-17T15:12:30.497Z
Kevin Reid
<p>I've implemented a simple color burn function in one of my shaders and I understand the results (I think), but the math behind it, although simple, is unintuitive to me. I struggle to understand how would one invent this formula from scratch in search of the given effect. Could someone clarify how one comes from</p>
<p>&quot;I need to increase the distance between the darkest and the lightest shades of the image.&quot;</p>
<p>to</p>
<p>&quot;invert bottom layer and divide by the top layer, and then invert the result.&quot;</p>

<pixel-shader><blending>
What's the intuition behind color burn and other blend modes?
TECHNOBOG
# What's the intuition behind color burn and other blend modes?

(Asked by: username_0 on 2023-08-17)

I've implemented a simple color burn function in one of my shaders and I understand the results (I think), but the math behind it, although simple, is unintuitive to me. I struggle to understand how would one invent this formula from scratch in search of the given effect. Could someone clarify how one comes from

"I need to increase the distance between the darkest and the lightest shades of the image."

to

"invert bottom layer and divide by the top layer, and then invert the result."

**Tags:** pixel-shader, blending


---

## 1 answers

### Answer by username_1 on 2023-08-17. Score: 1 | Accepted answer

In general, notice that there is no particular reason for a blend mode or other color processing formula *in an image manipulation program* to be reasonable “from first principles” at all. All we care about is that, empirically, it produces an artistically useful result.

That said, we can make some useful observations about the structure of this particular operation:

1. By inverting a color (that is, subtracting each component from 1), we can think of the resulting numbers as being “distance from white” in the same way that regular color components are “distance from black”. This preserves all the original information, but represents it differently.
2. If you invert twice, you get the same color back. So, overall, the two inversions don't change the color; if we *didn't* do something in the middle, the overall operation would do nothing.
3. Thus, we can think of the operation in the middle, the division as “operating in distance-from-white space”. By dividing by a number less than 1 (the value from the top layer), we scale up the distance-from-white of the color — darkening it.

Notice also that the “burn” in the name [comes from film photography](https://en.wikipedia.org/wiki/Dodging_and_burning). The ordinary process of developing photographs inverts color twice (which is why the developed “negative” film is called that and looks the way it does), and dodging and burning were about manipulating the intensity of the light that fell on the print after passing through the negative. Thus, the digital/mathematical emulation of the technique also involves two inversions and a scaling, performed by optical and chemical processes.


---

