{"id":1655,"date":"2014-12-31T13:50:09","date_gmt":"2014-12-31T12:50:09","guid":{"rendered":"http:\/\/photo.zakkinen.net\/?p=1655"},"modified":"2021-03-13T19:49:12","modified_gmt":"2021-03-13T18:49:12","slug":"ps-blend-modes-1","status":"publish","type":"post","link":"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-1\/","title":{"rendered":"Photoshop Blend Modes - Part 1","raw":"Photoshop Blend Modes - Part 1"},"content":{"rendered":"<p>I tried to figure out the frequency separation method for retouching portraits. Initially I didn&#8217;t really understand why which step was used. So I first had to dig deeper into the Photoshop (PS) blend modes. There&#8217;s a lot you can find on the internet regarding blend modes. Not everything I found was correct, let alone understandable for me. Especially photographers and PS users approach the subject rather intuitively, not many try to understand the math behind the tools they apply. Though that would help predicting the effects that can be achieved.<\/p>\n<p>So I decided to find out what exactly happens with the goal to write a concise, but not too complicated explanation myself. The first surprise during my research was that not everybody (not even the graphic software vendors) mean the same when they talk about soft light for example. Adobe is undisputedly one of the leaders on the market, but in PS in particular some of the blend modes are implemented not really well (my humble opinion, of course).<\/p>\n<h1>The Task<\/h1>\n<p>Calculate a new image from two existing.<\/p>\n<p>This is always used when you place two layers above each other in PS. The simplest, but also most boring blend mode, is making the upper layer opaque so you see nothing of the lower layer. You can use other blend modes to manipulate colours and luminosity of the lower source by the upper source (yes, in some cases the order is important, like with an opaque layer). That is what photographers use blend modes for.<\/p>\n<h1>Assumptions, Simplifications and Definitions<\/h1>\n<p>Assumption: the the value for a particular pixel of the new image (the target) can be deduced from the values of the corresponding pixels (same position, i. e. same coordinates) of the two source images.<\/p>\n<p>Simplification: all I present I only show for luminosity or rather black and white images with just one channel. The same holds for RGB images with three separate channels, on just uses the same formulas thrice, they are not influencing each other. Transparency (alpha-channel) shall be ignored for now as well.<\/p>\n<p>I will call the source images A and B, das target image C. If you are thinking layers, think A the lower layer, B the upper. C is what PS displays on the screen.<br \/>\nI shall use a common orthogonal coordinate system defined by counting pixel columns and rows from the lower left corner. The location of any pixel is precisely defined by its coordinates <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%28x%2C+y%29&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"(x, y)\" class=\"latex\" \/>.<\/p>\n<p>Let <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=a%28x%2Cy%29&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"a(x,y)\" class=\"latex\" \/> be the value (luminosity) of a pixel of image A, <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b%28x%2Cy%29&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b(x,y)\" class=\"latex\" \/> the value for a pixel of B with the same coordinates. As a result of a calculation you get a pixel-value of C: <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=c%28x%2Cy%29+%3D+f%28a%28x%2Cy%29%2Cb%28x%2Cy%29%29&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"c(x,y) = f(a(x,y),b(x,y))\" class=\"latex\" \/>.<\/p>\n<p>For better readability I will leave out the coordinates, at least as long as no pixels with differring coordinates are involved in the calculatation.<\/p>\n<p><span style=\"font-weight: 300;\">Pixel-values will always be given in numbers between <span style=\"font-weight: 300;\"><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=0&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"0\" class=\"latex\" \/> (zero)<\/span> for black and\u00a0<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=1&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"1\" class=\"latex\" \/> (one) for white, regardless of the actual bit depth. When calculating <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=c%28x%2Cy%29&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"c(x,y)\" class=\"latex\" \/>, you have to keep in mind that its value also is restricted to this interval.<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=a%2Cb%2Cc+%5Cin+%5B0%2C1%5D&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"a,b,c &#92;in [0,1]\" class=\"latex\" \/><\/p>\n<p>You will immediately see a difficulty: there are plenty of ways to combine 0 and 1 by a formula that gives values outside this interval. PS solves this problem by truncating the exceeding values. Anything below 0 or above 1 is ignored. That has some nasty consequences whenever you try to do several calculation steps in sequence. Part of the information is lost. You can not calculate\u00a0<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Cfrac%7Ba%2Bb%7D%7B2%7D&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"&#92;frac{a+b}{2}\" class=\"latex\" \/> in PS by executing <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=a%2Bb&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"a+b\" class=\"latex\" \/> and <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=%5Cfrac%7B1%7D%7B2%7D&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"&#92;frac{1}{2}\" class=\"latex\" \/> this, though it seems mathematically correct to do so.<\/p>\n<h1>Visualisation<\/h1>\n<p>To visualise the results I use two images as a basis for all blends. These contain values linear from 0 to 1, once from left to right (<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=a%28x%2Cy%29+%3D+x&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"a(x,y) = x\" class=\"latex\" \/>, defines a horizontal axis for a from 0 to 1), once from bottom to top (<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b%28x%2Cy%29+%3D+y&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b(x,y) = y\" class=\"latex\" \/>, the vertical axis from 0 to 1). This makes sure the result contains all possible combinations and we will see how smooth transitions are.<\/p>\n<figure id=\"attachment_1683\" aria-describedby=\"caption-attachment-1683\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1683\" data-permalink=\"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-1\/gradient-horizontal-2\/\" data-orig-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\" data-orig-size=\"300,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Gradient-horizontal\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\" class=\"wp-image-1683 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\" alt=\"Gradient-horizontal\" width=\"300\" height=\"300\" srcset=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png 300w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1-200x200.png 200w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1-50x50.png 50w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1683\" class=\"wp-caption-text\">Image A<\/figcaption><\/figure>\n<figure id=\"attachment_1684\" aria-describedby=\"caption-attachment-1684\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1684\" data-permalink=\"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-1\/gradient-vertikal-2\/\" data-orig-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\" data-orig-size=\"300,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Gradient-Vertikal\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\" class=\"wp-image-1684 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\" alt=\"Gradient-Vertikal\" width=\"300\" height=\"300\" srcset=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png 300w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1-200x200.png 200w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1-50x50.png 50w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1684\" class=\"wp-caption-text\">Image B<\/figcaption><\/figure>\n<h1>Blend Modes<\/h1>\n<p>To begin with I&#8217;ll have a look at some simple, but not trivial methods, multiplication and addition, then a combination of both and finally a version that uses two different formulas depending on the pixel-values of B. Further blend modes I will explain in the next part of this series.<\/p>\n<h2>Multiply<\/h2>\n<p>Multiplication is one of the simplest blends, because the function does not give any values outside the allowed interval or 0 to 1. By the way, PS indeed uses multiplication, not the geometric mean, though the latter might seem more plausible.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28a%2Cb%29+%3D+a+%5Ccdot+b&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(a,b) = a &#92;cdot b\" class=\"latex\" \/><\/p>\n<p>Results for a and b between 0 and 1 lie within that interval as well.<\/p>\n<p>For my test images you get:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28x%2Cy%29+%3D+a%28x%2Cy%29+%5Ccdot+b%28x%2Cy%29+%3D+x+%5Ccdot+y&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(x,y) = a(x,y) &#92;cdot b(x,y) = x &#92;cdot y\" class=\"latex\" \/><\/p>\n<p>Looking at the result you can see that two edges and hence three of the corners should be black, because a multiplication with 0 always yields 0. Only in the top right corner you get a value of 1 for white.<\/p>\n<figure id=\"attachment_1743\" aria-describedby=\"caption-attachment-1743\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1743\" data-permalink=\"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-1\/multiply-2\/\" data-orig-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\" data-orig-size=\"300,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Multiply\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\" class=\"wp-image-1743 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\" alt=\"Multiply\" width=\"300\" height=\"300\" srcset=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png 300w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1-200x200.png 200w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1-50x50.png 50w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1743\" class=\"wp-caption-text\">Multipy<\/figcaption><\/figure>\n<h3>Aside: Geometric Mean (not available in Photoshop)<\/h3>\n<p>For me the geometric mean<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28a%2Cb%29+%3D+%5Csqrt%7Ba+%5Ccdot+b%7D&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(a,b) = &#92;sqrt{a &#92;cdot b}\" class=\"latex\" \/><\/p>\n<p>seems to be the better option. There&#8217;d be a nice linear transition along the diagonal.<\/p>\n<h2>Linear Dodge<\/h2>\n<p>Linear Dodge is the name given to the addition. It is immediately clear that an addition of two numbers between 0 and 1 yealds results between 0 and 2. For half of the pixels the results get truncated to 1. Used on photos, this can easily lead to burnt out areas.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28a%2Cb%29+%3D+a+%2B+b&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(a,b) = a + b\" class=\"latex\" \/><\/p>\n<p>If the sum a+b gets larger then 1, it is replaced by 1. The formula never gives results below 0 anyway, so no truncating there. Hence you&#8217;d expect white on and above the diagonal between top left and bottom right, below that a linear gradient down to black in the bottom left corner.<\/p>\n<figure id=\"attachment_1687\" aria-describedby=\"caption-attachment-1687\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1687\" data-permalink=\"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-1\/linear-dodge\/\" data-orig-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\" data-orig-size=\"300,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Linear-Dodge\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Linear Abwedeln&lt;\/p&gt;\n\" data-large-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\" class=\"size-full wp-image-1687\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\" alt=\"Linear Abwedeln\" width=\"300\" height=\"300\" srcset=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png 300w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge-200x200.png 200w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge-50x50.png 50w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1687\" class=\"wp-caption-text\">Linear Dodge<\/figcaption><\/figure>\n<h2>Linear Burn<\/h2>\n<p>This is the negative inverse of linear dodge. It is the same as problematic on photos, you might get fully black areas.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28a%2Cb%29+%3D+a+%2B+b+-+1&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(a,b) = a + b - 1\" class=\"latex\" \/><\/p>\n<p>If the sum a+b gets less then 1, f is replaced by 0. Values above 1 are never reached anyway, no truncating. Hence you&#8217;d expect black on and below the diagonal between top left and bottom right, above that a linear gradient up to white in the top right corner.<\/p>\n<figure id=\"attachment_1686\" aria-describedby=\"caption-attachment-1686\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1686\" data-permalink=\"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-1\/linear-burn\/\" data-orig-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\" data-orig-size=\"300,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Linear-Burn\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\" class=\"wp-image-1686 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\" alt=\"Linear-Burn\" width=\"300\" height=\"300\" srcset=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png 300w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn-200x200.png 200w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn-50x50.png 50w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1686\" class=\"wp-caption-text\">Linear Burn<\/figcaption><\/figure>\n<h2>Linear Light<\/h2>\n<p>Frequently you will find linear light described as a combination of linear dodge for <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b%3C0.5&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b&lt;0.5\" class=\"latex\" \/> and linear burn for <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b+%5Cgeq+0.5&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b &#92;geq 0.5\" class=\"latex\" \/>. Not quite right, but close. If for\u00a0<img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b+%5Cgeq+0.5&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b &#92;geq 0.5\" class=\"latex\" \/> you compress the formula for linear dodge on the b-axis by a factor 2 and shift it up that axis by 1\/2, and then also compress the one for linear burn for <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b+%5Cgeq+0.5&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b &#92;geq 0.5\" class=\"latex\" \/> by a factor 2 on the b-axis, you indeed get:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28a%2Cb%29+%3D+%5Cleft%5C%7B%5Cbegin%7Barray%7D%7Blr%7D+a%2B2b-1+%26+%5Ctext%7Bfor+%7D+b+%3C+%7B1%2F2%7D%5C%5C+a+%2B+2%28b+-1%2F2%29+%26+%5Ctext%7Bfor+%7D+b+%5Cgeq+%7B1%2F2%7D+%5Cend%7Barray%7D+%5Cright.&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(a,b) = &#92;left&#92;{&#92;begin{array}{lr} a+2b-1 &amp; &#92;text{for } b &lt; {1\/2}&#92;&#92; a + 2(b -1\/2) &amp; &#92;text{for } b &#92;geq {1\/2} &#92;end{array} &#92;right.\" class=\"latex\" \/><\/p>\n<p>Or, by resolving the terms, simply:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28a%2Cb%29+%3D+a+%2B+2b+-+1&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(a,b) = a + 2b - 1\" class=\"latex\" \/><\/p>\n<p>This is no longer commutative in a and b. Swapping the images A and B will yield a different resulting C.<\/p>\n<p>Along the left edge (a=0) you expect black from the bottom up to b=0.5, then a linear transition to white. On the bottom edge (b=0) just black, because the -1 makes sure all possible results are negative. For b= 1 you get white on the top edge. On the right edge (a=1) you get from b=0 to b=0.5 a linear transition from black to white, above that just white.<\/p>\n<figure id=\"attachment_1685\" aria-describedby=\"caption-attachment-1685\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1685\" data-permalink=\"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-1\/linear-light\/\" data-orig-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\" data-orig-size=\"300,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Linear-Light\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\" class=\"wp-image-1685 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\" alt=\"Linear-Light\" width=\"300\" height=\"300\" srcset=\"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png 300w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light-200x200.png 200w, https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light-50x50.png 50w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1685\" class=\"wp-caption-text\">Lineares Licht<\/figcaption><\/figure>\n<p>Of interest for the PS user is the fact that an image B with <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b%3D0.5&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b=0.5\" class=\"latex\" \/> for all pixels transfers image A unchanged to C when combined with this blend mode. <img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=b%3D0.5&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=0&#038;c=20201002\" alt=\"b=0.5\" class=\"latex\" \/> is 50 % grey, which is called the neutral colour for linear light. Linear light is often used to manipulate a photo by using an almost grey layer with only minimal deviations, for example in high-pass sharpening or as one step of the frequency separation method.<\/p>\n<p>Linear light can be described as the sequential execution of linear dodge and linear burn (with B multiplied by 2) or as linear burn with doubled B. The latter unfortunately cannot be recreated in PS, as it would need multiple steps, one of them yielding results outside the allowed interval. Intermediate results would be truncated, the main result would be wrong.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/s0.wp.com\/latex.php?latex=f%28a%2Cb%29%3D+%28a%2Bb%29+%2B+b+-+1+%3D+a+%2B+2b+-+1&#038;bg=2a2a2a&#038;fg=ffffff&#038;s=1&#038;c=20201002\" alt=\"f(a,b)= (a+b) + b - 1 = a + 2b - 1\" class=\"latex\" \/><\/p>\n<h1>Other parts of this mini-series<\/h1>\n<p><a href=\"\/en\/ps-blend-modes-2\/\">Blend Modes &#8211; Part 2: Color Burn, Color Dodge, Screen, Overlay, Hard Light and Vivid Light<\/a><\/p>\n<p><a href=\"\/en\/ps-blend-modes-3\/\">Blend Modes &#8211; Part 3: Soft Light<\/a><\/p>\n<h1>Sources<\/h1>\n<ul>\n<li><a title=\"Blend Modes\" href=\"http:\/\/en.wikipedia.org\/wiki\/Blend_modes\" target=\"_blank\" rel=\"noopener\">Wikipedia on Blend Modes<\/a><\/li>\n<li><a title=\"Blend effect\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/hh706313%28v=vs.85%29.aspx#sample_code\" target=\"_blank\" rel=\"noopener\">Microsoft Developer Network, DirectX, Direct2D<\/a><\/li>\n<li><a title=\"Blend Modes\" href=\"http:\/\/www.pegtop.net\/delphi\/articles\/blendmodes\" target=\"_blank\" rel=\"noopener\">Pegtop<\/a><\/li>\n<li><a title=\"How does photoshop blend two images together?\" href=\"http:\/\/stackoverflow.com\/questions\/5919663\/how-does-photoshop-blend-two-images-together\" target=\"_blank\" rel=\"noopener\">Stackoverflow<\/a><\/li>\n<li><a title=\"Compositing and Blending\" href=\"http:\/\/www.w3.org\/TR\/compositing-1\/#blending\" target=\"_blank\" rel=\"noopener\">W3C<\/a><\/li>\n<\/ul>\n","protected":false,"raw":"I tried to figure out the frequency separation method for retouching portraits. Initially I didn't really understand why which step was used. So I first had to dig deeper into the Photoshop (PS) blend modes. There's a lot you can find on the internet regarding blend modes. Not everything I found was correct, let alone understandable for me. Especially photographers and PS users approach the subject rather intuitively, not many try to understand the math behind the tools they apply. Though that would help predicting the effects that can be achieved.\n\nSo I decided to find out what exactly happens with the goal to write a concise, but not too complicated explanation myself. The first surprise during my research was that not everybody (not even the graphic software vendors) mean the same when they talk about soft light for example. Adobe is undisputedly one of the leaders on the market, but in PS in particular some of the blend modes are implemented not really well (my humble opinion, of course).\n<h1>The Task<\/h1>\nCalculate a new image from two existing.\n\nThis is always used when you place two layers above each other in PS. The simplest, but also most boring blend mode, is making the upper layer opaque so you see nothing of the lower layer. You can use other blend modes to manipulate colours and luminosity of the lower source by the upper source (yes, in some cases the order is important, like with an opaque layer). That is what photographers use blend modes for.\n<h1>Assumptions, Simplifications and Definitions<\/h1>\nAssumption: the the value for a particular pixel of the new image (the target) can be deduced from the values of the corresponding pixels (same position, i. e. same coordinates) of the two source images.\n\nSimplification: all I present I only show for luminosity or rather black and white images with just one channel. The same holds for RGB images with three separate channels, on just uses the same formulas thrice, they are not influencing each other. Transparency (alpha-channel) shall be ignored for now as well.\n\nI will call the source images A and B, das target image C. If you are thinking layers, think A the lower layer, B the upper. C is what PS displays on the screen.\nI shall use a common orthogonal coordinate system defined by counting pixel columns and rows from the lower left corner. The location of any pixel is precisely defined by its coordinates $latex (x, y)&amp;bg=2a2a2a&amp;fg=ffffff$.\n\nLet $latex a(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$ be the value (luminosity) of a pixel of image A, $latex b(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$ the value for a pixel of B with the same coordinates. As a result of a calculation you get a pixel-value of C: $latex c(x,y) = f(a(x,y),b(x,y))&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$.\n\nFor better readability I will leave out the coordinates, at least as long as no pixels with differring coordinates are involved in the calculatation.\n\n<span style=\"font-weight: 300;\">Pixel-values will always be given in numbers between <span style=\"font-weight: 300;\">$latex 0&amp;bg=2a2a2a&amp;fg=ffffff$ (zero)<\/span> for black and\u00a0$latex 1&amp;bg=2a2a2a&amp;fg=ffffff$ (one) for white, regardless of the actual bit depth. When calculating $latex c(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$, you have to keep in mind that its value also is restricted to this interval.<\/span>\n\n$latex a,b,c \\in [0,1]&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nYou will immediately see a difficulty: there are plenty of ways to combine 0 and 1 by a formula that gives values outside this interval. PS solves this problem by truncating the exceeding values. Anything below 0 or above 1 is ignored. That has some nasty consequences whenever you try to do several calculation steps in sequence. Part of the information is lost. You can not calculate\u00a0$latex \\frac{a+b}{2}&amp;bg=2a2a2a&amp;fg=ffffff$ in PS by executing $latex a+b&amp;bg=2a2a2a&amp;fg=ffffff$ and $latex \\frac{1}{2}&amp;bg=2a2a2a&amp;fg=ffffff$ this, though it seems mathematically correct to do so.\n<h1>Visualisation<\/h1>\nTo visualise the results I use two images as a basis for all blends. These contain values linear from 0 to 1, once from left to right ($latex a(x,y) = x&amp;bg=2a2a2a&amp;fg=ffffff$, defines a horizontal axis for a from 0 to 1), once from bottom to top ($latex b(x,y) = y&amp;bg=2a2a2a&amp;fg=ffffff$, the vertical axis from 0 to 1). This makes sure the result contains all possible combinations and we will see how smooth transitions are.\n\n[caption id=\"attachment_1683\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\"><img class=\"wp-image-1683 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\" alt=\"Gradient-horizontal\" width=\"300\" height=\"300\" \/><\/a> Image A[\/caption]\n\n[caption id=\"attachment_1684\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\"><img class=\"wp-image-1684 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\" alt=\"Gradient-Vertikal\" width=\"300\" height=\"300\" \/><\/a> Image B[\/caption]\n<h1>Blend Modes<\/h1>\nTo begin with I'll have a look at some simple, but not trivial methods, multiplication and addition, then a combination of both and finally a version that uses two different formulas depending on the pixel-values of B. Further blend modes I will explain in the next part of this series.\n<h2>Multiply<\/h2>\nMultiplication is one of the simplest blends, because the function does not give any values outside the allowed interval or 0 to 1. By the way, PS indeed uses multiplication, not the geometric mean, though the latter might seem more plausible.\n\n$latex f(a,b) = a \\cdot b&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nResults for a and b between 0 and 1 lie within that interval as well.\n\nFor my test images you get:\n\n$latex f(x,y) = a(x,y) \\cdot b(x,y) = x \\cdot y&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nLooking at the result you can see that two edges and hence three of the corners should be black, because a multiplication with 0 always yields 0. Only in the top right corner you get a value of 1 for white.\n\n[caption id=\"attachment_1743\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\"><img class=\"wp-image-1743 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\" alt=\"Multiply\" width=\"300\" height=\"300\" \/><\/a> Multipy[\/caption]\n<h3>Aside: Geometric Mean (not available in Photoshop)<\/h3>\nFor me the geometric mean\n\n$latex f(a,b) = \\sqrt{a \\cdot b}&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nseems to be the better option. There'd be a nice linear transition along the diagonal.\n<h2>Linear Dodge<\/h2>\nLinear Dodge is the name given to the addition. It is immediately clear that an addition of two numbers between 0 and 1 yealds results between 0 and 2. For half of the pixels the results get truncated to 1. Used on photos, this can easily lead to burnt out areas.\n\n$latex f(a,b) = a + b&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nIf the sum a+b gets larger then 1, it is replaced by 1. The formula never gives results below 0 anyway, so no truncating there. Hence you'd expect white on and above the diagonal between top left and bottom right, below that a linear gradient down to black in the bottom left corner.\n\n[caption id=\"attachment_1687\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\"><img class=\"size-full wp-image-1687\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\" alt=\"Linear Abwedeln\" width=\"300\" height=\"300\" \/><\/a> Linear Dodge[\/caption]\n<h2>Linear Burn<\/h2>\nThis is the negative inverse of linear dodge. It is the same as problematic on photos, you might get fully black areas.\n\n$latex f(a,b) = a + b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nIf the sum a+b gets less then 1, f is replaced by 0. Values above 1 are never reached anyway, no truncating. Hence you'd expect black on and below the diagonal between top left and bottom right, above that a linear gradient up to white in the top right corner.\n\n[caption id=\"attachment_1686\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\"><img class=\"wp-image-1686 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\" alt=\"Linear-Burn\" width=\"300\" height=\"300\" \/><\/a> Linear Burn[\/caption]\n<h2>Linear Light<\/h2>\nFrequently you will find linear light described as a combination of linear dodge for $latex b&lt;0.5&amp;bg=2a2a2a&amp;fg=ffffff$ and linear burn for $latex b \\geq 0.5&amp;bg=2a2a2a&amp;fg=ffffff$. Not quite right, but close. If for\u00a0$latex b \\geq 0.5&amp;bg=2a2a2a&amp;fg=ffffff$ you compress the formula for linear dodge on the b-axis by a factor 2 and shift it up that axis by 1\/2, and then also compress the one for linear burn for $latex b \\geq 0.5&amp;bg=2a2a2a&amp;fg=ffffff$ by a factor 2 on the b-axis, you indeed get:\n\n$latex f(a,b) = \\left\\{\\begin{array}{lr} a+2b-1 &amp; \\text{for } b &lt; {1\/2}\\\\ a + 2(b -1\/2) &amp; \\text{for } b \\geq {1\/2} \\end{array} \\right.&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nOr, by resolving the terms, simply:\n\n$latex f(a,b) = a + 2b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nThis is no longer commutative in a and b. Swapping the images A and B will yield a different resulting C.\n\nAlong the left edge (a=0) you expect black from the bottom up to b=0.5, then a linear transition to white. On the bottom edge (b=0) just black, because the -1 makes sure all possible results are negative. For b= 1 you get white on the top edge. On the right edge (a=1) you get from b=0 to b=0.5 a linear transition from black to white, above that just white.\n\n[caption id=\"attachment_1685\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\"><img class=\"wp-image-1685 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\" alt=\"Linear-Light\" width=\"300\" height=\"300\" \/><\/a> Lineares Licht[\/caption]\n\nOf interest for the PS user is the fact that an image B with $latex b=0.5&amp;bg=2a2a2a&amp;fg=ffffff$ for all pixels transfers image A unchanged to C when combined with this blend mode. $latex b=0.5&amp;bg=2a2a2a&amp;fg=ffffff$ is 50 % grey, which is called the neutral colour for linear light. Linear light is often used to manipulate a photo by using an almost grey layer with only minimal deviations, for example in high-pass sharpening or as one step of the frequency separation method.\n\nLinear light can be described as the sequential execution of linear dodge and linear burn (with B multiplied by 2) or as linear burn with doubled B. The latter unfortunately cannot be recreated in PS, as it would need multiple steps, one of them yielding results outside the allowed interval. Intermediate results would be truncated, the main result would be wrong.\n\n$latex f(a,b)= (a+b) + b - 1 = a + 2b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n<h1>Other parts of this mini-series<\/h1>\n<a href=\"\/en\/ps-blend-modes-2\/\">Blend Modes - Part 2: Color Burn, Color Dodge, Screen, Overlay, Hard Light and Vivid Light<\/a>\n\n<a href=\"\/en\/ps-blend-modes-3\/\">Blend Modes - Part 3: Soft Light<\/a>\n<h1>Sources<\/h1>\n<ul>\n \t<li><a title=\"Blend Modes\" href=\"http:\/\/en.wikipedia.org\/wiki\/Blend_modes\" target=\"_blank\" rel=\"noopener\">Wikipedia on Blend Modes<\/a><\/li>\n \t<li><a title=\"Blend effect\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/hh706313%28v=vs.85%29.aspx#sample_code\" target=\"_blank\" rel=\"noopener\">Microsoft Developer Network, DirectX, Direct2D<\/a><\/li>\n \t<li><a title=\"Blend Modes\" href=\"http:\/\/www.pegtop.net\/delphi\/articles\/blendmodes\" target=\"_blank\" rel=\"noopener\">Pegtop<\/a><\/li>\n \t<li><a title=\"How does photoshop blend two images together?\" href=\"http:\/\/stackoverflow.com\/questions\/5919663\/how-does-photoshop-blend-two-images-together\" target=\"_blank\" rel=\"noopener\">Stackoverflow<\/a><\/li>\n \t<li><a title=\"Compositing and Blending\" href=\"http:\/\/www.w3.org\/TR\/compositing-1\/#blending\" target=\"_blank\" rel=\"noopener\">W3C<\/a><\/li>\n<\/ul>"},"excerpt":{"rendered":"","protected":false,"raw":""},"author":1,"featured_media":1686,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_de_post_content":"K\u00fcrzlich habe ich mich mit der Methode der Frequenztrennung (frequency separation) zur Retusche besch\u00e4ftigt. Bevor ich mir die Methode verst\u00e4ndlich machen konnte, musste ich mich erst mal mit den Verrechnungsmodi (Blend Modes) in Photoshop vertraut machen. Dazu gibt es eine Menge zu finden und zu sagen. Ich will einfach anfangen und versuchen, meine Ergebnisse verst\u00e4ndlich darzustellen, denn man findet eine Menge von Seiten im Web, die sich mit den Verrechnungsmodi bei Photoshop besch\u00e4ftigen, die man aber nicht verstehen kann. Manche der Erkl\u00e4rungen sind leider schlicht falsch, oft zu kompliziert. Insbesondere Fotografen und Photoshop-Anwender nehmen es nicht sehr genau mit den Formeln. Da ich verstehen wollte, was wirklich gemacht wird, habe ich mir einige genauer angesehen. Dabei habe ich feststellen m\u00fcssen, dass nicht alle Hersteller das gleiche meinen, wenn sie z. B. von Weiches Licht (Soft Light) sprechen. Adobe ist sicher der Platzhirsch, aber gerade bei Photoshop sind die Verfahren zum Teil eher schlecht implementiert.\n<h1>Aufgabenstellung<\/h1>\nAus zwei Bildern ist ein neues zu berechnen. Dabei ergibt sich der Wert eines Pixels im Zielbild aus den Werten der entsprechenden Pixel der beiden Quellbilder. Verwendet wird das u. a., wenn in Photoshop mehrere Ebenen \u00fcbereinander gelegt werden. Die einfachste, aber auch uninteressanteste Variante ist, die oberen Ebenen deckend zu machen, dann sieht man nur die oberste. Man kann aber auch andere Verrechnungsvorschriften nutzen und Farbe oder Helligkeit bzw. Kontrast des Bildes in der unteren Ebene mit der oberen Ebene manipulieren. Daf\u00fcr nutzen es Fotografen.\n<h1>Voraussetzungen und Definitionen<\/h1>\nDer Einfachkeit halber arbeite ich hier zun\u00e4chst nicht mit Farben, sondern nur mit der Helligkeit, also Schwarzwei\u00df. Das \u00e4ndert nichts an der G\u00fcltigkeit der Betrachtung, die Rechnung bei einem RGB-Bild ist f\u00fcr jeden Kanal einzeln durchzuf\u00fchren. Die Transparenz eines Bildes (Alpha-Kanal) ignoriere ich zun\u00e4chst auch.\n\nIch bezeichne die Quellbilder als A und B, das Zielbild als C. Wenn man an Ebenen denkt, w\u00e4re A die untere Ebene, B die obere. Ein gemeinsames rechtwinkliges Koordinatensystem sei definiert durch Abz\u00e4hlen der Pixel des Bildes. Der Ort eines Pixels ist bestimmt durch seine Koordinaten $latex (x, y)&amp;bg=2a2a2a&amp;fg=ffffff$\n\n$latex a(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$ sei der Helligkeitswert eines Pixels aus A, $latex b(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$ der eines Pixels aus B mit denselben Koordinaten. Das Ergebnis einer Berechnung ist\n\n$latex c(x,y) = f(a(x,y),b(x,y))&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$.\n\nIch lasse im Folgenden zur leichteren Lesbarkeit die Koordinaten weg, solange nur Pixel mit identischen Koordinaten verwendet werden.\n\nDie Helligkeitswerte werden unabh\u00e4ngig von der Bit-Tiefe der Bilder angegeben als Zahlen zwischen $latex 0$ (Null) f\u00fcr Schwarz und $latex 1&amp;bg=2a2a2a&amp;fg=ffffff$ (Eins) f\u00fcr Wei\u00df. Bei der Berechnung von Helligkeitswerten $latex c(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$ ist zu beachten, dass auch c zwischen $latex 0&amp;bg=2a2a2a&amp;fg=ffffff$ und $latex 1&amp;bg=2a2a2a&amp;fg=ffffff$ liegen muss.\n\n$latex a,b,c \\in [0,1]&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nEine Schwierigkeit ist sofort zu erkennen: es gibt eine Vielzahl von M\u00f6glichkeiten, zwei Zahlen zwischen 0 und 1 zu verrechnen und dabei Werte au\u00dferhalb des erlaubten Bereiches zu erhalten. Bei allen Verrechnungen wird in Photoshop ganz einfach vorgegangen: Werte kleiner 0 werden durch 0 ersetzt, Werte gr\u00f6\u00dfer 1 durch 1. Das hat h\u00e4ssliche Folgen, wenn man mehrere Verrechnungen hintereinander einsetzt, da Information verloren geht. So kann man in Photoshop leider nicht $latex \\frac{a+b}{2}&amp;bg=2a2a2a&amp;fg=ffffff$ durch Hintereinanderausf\u00fchren von $latex a+b&amp;bg=2a2a2a&amp;fg=ffffff$ und $latex \\frac{1}{2}&amp;bg=2a2a2a&amp;fg=ffffff$ erreichen.\n<h1>Darstellung<\/h1>\nZur Visualisierung verwende ich zwei Bilder, die miteinander verrechnet werden sollen. Diese enthalten alle Helligkeitswerte zwischen 0 und 1 als linearen Verlauf, einmal von rechts nach links ($latex a(x,y) = x&amp;bg=2a2a2a&amp;fg=ffffff$, gibt mir eine horizontale Achse f\u00fcr a von 0 bis 1) und einmal von unten nach oben ($latex b(x,y) = y&amp;bg=2a2a2a&amp;fg=ffffff$, vertikale Achse von 0 bis 1).\n\n[caption id=\"attachment_1683\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\"><img class=\"wp-image-1683 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\" alt=\"Gradient-horizontal\" width=\"300\" height=\"300\" \/><\/a> Bild A[\/caption]\n\n[caption id=\"attachment_1684\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\"><img class=\"wp-image-1684 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\" alt=\"Gradient-Vertikal\" width=\"300\" height=\"300\" \/><\/a> Bild B[\/caption]\n<h1>Verrechnungsmethoden<\/h1>\nIch m\u00f6chte zun\u00e4chst ein paar einfach, aber nicht v\u00f6llig triviale Methoden betrachten, die Multiplikation und Addition, dann eine Kombination von beidem und zum Schlu\u00df dieses Teils eine Variante, die abh\u00e4ngig vom Helligkeitswert der Pixel in B zwei unterschiedliche Formeln verwendet.\n<h2>Multiplikation (Multiply)<\/h2>\nDie Multiplikation ist eine der einfachsten Verrechnungen, weil die Funktion keine Werte au\u00dferhalb des Intervalls 0 bis 1 liefert. Photoshop verwendet \u00fcbrigens wirklich die Multiplikation, nicht das geometrische Mittel.\n\n$latex f(a,b) = a \\cdot b&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nDas Ergebnis liegt wieder zwischen 0 und 1.\n\nBei meinen Testbildern ergibt sich:\n\n$latex f(x,y) = a(x,y) \\cdot b(x,y) = x \\cdot y&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nZwei Kanten und damit drei der Ecken sollten Schwarz sein, weil eine Multiplikation mit 0 immer 0 ergibt. Wei\u00df ergibt sich nur in der oberen rechten Ecke.\n\n[caption id=\"attachment_1743\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\"><img class=\"wp-image-1743 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\" alt=\"Multiply\" width=\"300\" height=\"300\" \/><\/a> Multipliziert[\/caption]\n<h3>\u00a0Ausflug: Geometrisches Mittel (nicht in Photoshop verf\u00fcgbar)<\/h3>\nDas geometrische Mittel\n\n$latex f(a,b) = \\sqrt{a \\cdot b}&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nw\u00e4re f\u00fcr mich eigentlich die bessere Variante. Es erg\u00e4be sich l\u00e4ngs der Diagonale ein h\u00fcbsch linearer Verlauf.\n<h2>Linear Abwedeln (Linear Dodge)<\/h2>\nLinear Abwedeln entspricht der Addition. Es ist sofort klar, dass die Addition zweier Zahlen zwischen 0 und 1 Ergebnisse zwischen 0 und 2 liefert. Die H\u00e4lfte der Ergebnisse werden also bei 1 abgeschnitten. Bei Fotos kann das zu leicht ausgebrannten Fl\u00e4chen f\u00fchren.\n\n$latex f(a,b) = a + b&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nWenn die Summe von a+b gr\u00f6\u00dfer wird als 1, wird f\u00fcr f 1 angenommen. Werte unter 0 sind nicht erreichbar, auf dieser Seite wird also nicht abgeschnitten. Man erwartet daher Wei\u00df auf und oberhalb der Diagonale von oben links nach unten rechts, darunter einen linearen Verlauf zu Schwarz.\n\n[caption id=\"attachment_1687\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\"><img class=\"size-full wp-image-1687\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\" alt=\"Linear Abwedeln\" width=\"300\" height=\"300\" \/><\/a> Linear Abwedeln[\/caption]\n<h2>Linear Nachbelichten (Linear Burn)<\/h2>\nLineares Nachbelichten ist das negative inverse von Linearem Abwedeln. Es gibt die gleichen Probleme, Tiefen k\u00f6nnen leicht absaufen.\n\n$latex f(a,b) = a + b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nWenn die Summe von a und b kleiner ist als 1 wird f kleiner als 0, dann wird 0 angenommen. Werte \u00fcber 1 sind nicht erreichbar, auf dieser Seite wird nicht abgeschnitten. Man erwartet daher Schwarz auf und unterhalb der Diagonale von oben links nach unten rechts. Dar\u00fcber einen linearen Verlauf zu Wei\u00df.\n\n[caption id=\"attachment_1686\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\"><img class=\"wp-image-1686 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\" alt=\"Linear-Burn\" width=\"300\" height=\"300\" \/><\/a> Linear Nachbelichten[\/caption]\n<h2>Lineares Licht (Linear Light)<\/h2>\nLineares Licht findet man oft beschieben als eine Kombination von Linearem Abwedeln f\u00fcr $latex b&lt;0,5&amp;bg=2a2a2a&amp;fg=ffffff$ und Linearem Nachbelichten f\u00fcr $latex b \\geq 0,5&amp;bg=2a2a2a&amp;fg=ffffff$. Das ist nicht ganz richtig, aber fast. Wenn man die Formel f\u00fcr Lineares Nachbelichten f\u00fcr $latex b \\geq 0,5&amp;bg=2a2a2a&amp;fg=ffffff$ auf der b-Achse um den Faktor 2 staucht und um 1\/2 verschiebt und die f\u00fcr Lineares Nachbelichten f\u00fcr\u00a0 $latex b \\geq 0,5&amp;bg=2a2a2a&amp;fg=ffffff$ auch mit dem Faktor 2 auf der b-Achse staucht, dann erh\u00e4lt man tats\u00e4chlich:\n\n$latex f(a,b) = \\left\\{ \\begin{array}{lr} a+2b-1 &amp; \\text{f\\\"ur } b &lt; 1\/2\\\\ a+2(b-1\/2) &amp; \\text{f\\\"ur } b \\geq 1\/2 \\end{array} \\right.&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nOder nach Aufl\u00f6sen halt einfach:\n\n$latex f(a,b) = a + 2b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nDie Verrechnung ist nicht mehr kommutativ, man kann also A und B nicht tauschen.\n\nAuf der linken Kante (a=0) erwartet man von unten nach oben Schwarz bis b=0,5, danach einen linearen Verlauf zu Wei\u00df. Auf der unteren Kante (b=0) nur Schwarz, weil die -1 alle m\u00f6glichen Ergebnisse negativ macht. Mit b= 1 ergibt sich auf der oberen Kante ein durchg\u00e4ngiges Wei\u00df. Auf der rechten Kante (a=1) erh\u00e4lt man von unten nach oben einen linearen Verlauf von Schwarz zu Wei\u00df bei b=0,5.\n\n[caption id=\"attachment_1685\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\"><img class=\"wp-image-1685 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\" alt=\"Linear-Light\" width=\"300\" height=\"300\" \/><\/a> Lineares Licht[\/caption]\n\nInteressant f\u00fcr die Verwendung in Photoshop ist, dass ein Bild B mit durchgehend $latex b=0,5&amp;bg=2a2a2a&amp;fg=ffffff$ das Bild A bei dieser Verrechnung unver\u00e4ndert in C \u00fcbernimmt. Die neutrale Farbe f\u00fcr B f\u00fcr Lineares Licht ist 50% Grau. Lineares Licht wird gern verwendet, um ein Foto mit einer fast grauen Ebene mit geringen Abweichungen zu manipulieren, z. B. bei dem sogenannten Frequenztrennungs-Verfahren.\n\nDie Methode l\u00e4sst sich darstellen als das Ergebnis von beiden Verrechnungsmethoden nacheinander angewandt (bei zweifacher Verwendung von B), oder auch einfach als Lineares Nachbelichten mit verdoppeltem B (das l\u00e4sst sich leider in Photoshop nicht so einfach mit mehreren Einzelschritten bewerkstelligen, da auch Zwischenergebnisse au\u00dferhalb 0 und 1 abgeschnitten werden).\n\n$latex f(a,b)= (a+b) + b - 1 = a + 2b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n<h1>Die anderen Teile dieser Miniserie<\/h1>\n<a href=\"\/verrechnungsmodiphotoshop-teil-2\">Verrechnungsmodi in Photoshop - Teil 2: Farbig Nachbelichten, Farbig Abwedeln, Negativ Multiplizieren, Ineinanderkopieren, Hartes Licht und Strahlendes Licht<\/a>\n\n<a href=\"\/verrechnungsmodiphotoshop-teil-3\">Verrechnungsmodi in Photoshop - Teil 3: Weiches Licht<\/a>\n<h1>Quellen<\/h1>\n<ul>\n \t<li style=\"list-style-type: none;\">\n<ul>\n \t<li><a title=\"Blend Modes\" href=\"http:\/\/en.wikipedia.org\/wiki\/Blend_modes\" target=\"_blank\" rel=\"noopener\">Wikipedia (englisch)<\/a><\/li>\n \t<li><a title=\"Blend effect\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/hh706313%28v=vs.85%29.aspx#sample_code\" target=\"_blank\" rel=\"noopener\">Microsoft Developer Network, DirectX, Direct2D<\/a><\/li>\n \t<li><a title=\"Blend Modes\" href=\"http:\/\/www.pegtop.net\/delphi\/articles\/blendmodes\" target=\"_blank\" rel=\"noopener\">Pegtop<\/a><\/li>\n \t<li><a title=\"How does photoshop blend two images together?\" href=\"http:\/\/stackoverflow.com\/questions\/5919663\/how-does-photoshop-blend-two-images-together\" target=\"_blank\" rel=\"noopener\">Stackoverflow<\/a><\/li>\n \t<li><a title=\"Compositing and Blending\" href=\"http:\/\/www.w3.org\/TR\/compositing-1\/#blending\" target=\"_blank\" rel=\"noopener\">W3C<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n \t<li style=\"list-style-type: none;\"><\/li>\n<\/ul>","_de_post_name":"verrechnungsmodiphotoshop-teil-1","_de_post_excerpt":"","_de_post_title":"Verrechnungsmodi in Photoshop - Teil 1","_en_post_content":"I tried to figure out the frequency separation method for retouching portraits. Initially I didn't really understand why which step was used. So I first had to dig deeper into the Photoshop (PS) blend modes. There's a lot you can find on the internet regarding blend modes. Not everything I found was correct, let alone understandable for me. Especially photographers and PS users approach the subject rather intuitively, not many try to understand the math behind the tools they apply. Though that would help predicting the effects that can be achieved.\n\nSo I decided to find out what exactly happens with the goal to write a concise, but not too complicated explanation myself. The first surprise during my research was that not everybody (not even the graphic software vendors) mean the same when they talk about soft light for example. Adobe is undisputedly one of the leaders on the market, but in PS in particular some of the blend modes are implemented not really well (my humble opinion, of course).\n<h1>The Task<\/h1>\nCalculate a new image from two existing.\n\nThis is always used when you place two layers above each other in PS. The simplest, but also most boring blend mode, is making the upper layer opaque so you see nothing of the lower layer. You can use other blend modes to manipulate colours and luminosity of the lower source by the upper source (yes, in some cases the order is important, like with an opaque layer). That is what photographers use blend modes for.\n<h1>Assumptions, Simplifications and Definitions<\/h1>\nAssumption: the the value for a particular pixel of the new image (the target) can be deduced from the values of the corresponding pixels (same position, i. e. same coordinates) of the two source images.\n\nSimplification: all I present I only show for luminosity or rather black and white images with just one channel. The same holds for RGB images with three separate channels, on just uses the same formulas thrice, they are not influencing each other. Transparency (alpha-channel) shall be ignored for now as well.\n\nI will call the source images A and B, das target image C. If you are thinking layers, think A the lower layer, B the upper. C is what PS displays on the screen.\nI shall use a common orthogonal coordinate system defined by counting pixel columns and rows from the lower left corner. The location of any pixel is precisely defined by its coordinates $latex (x, y)&amp;bg=2a2a2a&amp;fg=ffffff$.\n\nLet $latex a(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$ be the value (luminosity) of a pixel of image A, $latex b(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$ the value for a pixel of B with the same coordinates. As a result of a calculation you get a pixel-value of C: $latex c(x,y) = f(a(x,y),b(x,y))&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$.\n\nFor better readability I will leave out the coordinates, at least as long as no pixels with differring coordinates are involved in the calculatation.\n\n<span style=\"font-weight: 300;\">Pixel-values will always be given in numbers between <span style=\"font-weight: 300;\">$latex 0&amp;bg=2a2a2a&amp;fg=ffffff$ (zero)<\/span> for black and\u00a0$latex 1&amp;bg=2a2a2a&amp;fg=ffffff$ (one) for white, regardless of the actual bit depth. When calculating $latex c(x,y)&amp;bg=2a2a2a&amp;fg=ffffff$, you have to keep in mind that its value also is restricted to this interval.<\/span>\n\n$latex a,b,c \\in [0,1]&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nYou will immediately see a difficulty: there are plenty of ways to combine 0 and 1 by a formula that gives values outside this interval. PS solves this problem by truncating the exceeding values. Anything below 0 or above 1 is ignored. That has some nasty consequences whenever you try to do several calculation steps in sequence. Part of the information is lost. You can not calculate\u00a0$latex \\frac{a+b}{2}&amp;bg=2a2a2a&amp;fg=ffffff$ in PS by executing $latex a+b&amp;bg=2a2a2a&amp;fg=ffffff$ and $latex \\frac{1}{2}&amp;bg=2a2a2a&amp;fg=ffffff$ this, though it seems mathematically correct to do so.\n<h1>Visualisation<\/h1>\nTo visualise the results I use two images as a basis for all blends. These contain values linear from 0 to 1, once from left to right ($latex a(x,y) = x&amp;bg=2a2a2a&amp;fg=ffffff$, defines a horizontal axis for a from 0 to 1), once from bottom to top ($latex b(x,y) = y&amp;bg=2a2a2a&amp;fg=ffffff$, the vertical axis from 0 to 1). This makes sure the result contains all possible combinations and we will see how smooth transitions are.\n\n[caption id=\"attachment_1683\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\"><img class=\"wp-image-1683 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-horizontal1.png\" alt=\"Gradient-horizontal\" width=\"300\" height=\"300\" \/><\/a> Image A[\/caption]\n\n[caption id=\"attachment_1684\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\"><img class=\"wp-image-1684 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Gradient-Vertikal1.png\" alt=\"Gradient-Vertikal\" width=\"300\" height=\"300\" \/><\/a> Image B[\/caption]\n<h1>Blend Modes<\/h1>\nTo begin with I'll have a look at some simple, but not trivial methods, multiplication and addition, then a combination of both and finally a version that uses two different formulas depending on the pixel-values of B. Further blend modes I will explain in the next part of this series.\n<h2>Multiply<\/h2>\nMultiplication is one of the simplest blends, because the function does not give any values outside the allowed interval or 0 to 1. By the way, PS indeed uses multiplication, not the geometric mean, though the latter might seem more plausible.\n\n$latex f(a,b) = a \\cdot b&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nResults for a and b between 0 and 1 lie within that interval as well.\n\nFor my test images you get:\n\n$latex f(x,y) = a(x,y) \\cdot b(x,y) = x \\cdot y&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nLooking at the result you can see that two edges and hence three of the corners should be black, because a multiplication with 0 always yields 0. Only in the top right corner you get a value of 1 for white.\n\n[caption id=\"attachment_1743\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\"><img class=\"wp-image-1743 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Multiply1.png\" alt=\"Multiply\" width=\"300\" height=\"300\" \/><\/a> Multipy[\/caption]\n<h3>Aside: Geometric Mean (not available in Photoshop)<\/h3>\nFor me the geometric mean\n\n$latex f(a,b) = \\sqrt{a \\cdot b}&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nseems to be the better option. There'd be a nice linear transition along the diagonal.\n<h2>Linear Dodge<\/h2>\nLinear Dodge is the name given to the addition. It is immediately clear that an addition of two numbers between 0 and 1 yealds results between 0 and 2. For half of the pixels the results get truncated to 1. Used on photos, this can easily lead to burnt out areas.\n\n$latex f(a,b) = a + b&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nIf the sum a+b gets larger then 1, it is replaced by 1. The formula never gives results below 0 anyway, so no truncating there. Hence you'd expect white on and above the diagonal between top left and bottom right, below that a linear gradient down to black in the bottom left corner.\n\n[caption id=\"attachment_1687\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\"><img class=\"size-full wp-image-1687\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Dodge.png\" alt=\"Linear Abwedeln\" width=\"300\" height=\"300\" \/><\/a> Linear Dodge[\/caption]\n<h2>Linear Burn<\/h2>\nThis is the negative inverse of linear dodge. It is the same as problematic on photos, you might get fully black areas.\n\n$latex f(a,b) = a + b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nIf the sum a+b gets less then 1, f is replaced by 0. Values above 1 are never reached anyway, no truncating. Hence you'd expect black on and below the diagonal between top left and bottom right, above that a linear gradient up to white in the top right corner.\n\n[caption id=\"attachment_1686\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\"><img class=\"wp-image-1686 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png\" alt=\"Linear-Burn\" width=\"300\" height=\"300\" \/><\/a> Linear Burn[\/caption]\n<h2>Linear Light<\/h2>\nFrequently you will find linear light described as a combination of linear dodge for $latex b&lt;0.5&amp;bg=2a2a2a&amp;fg=ffffff$ and linear burn for $latex b \\geq 0.5&amp;bg=2a2a2a&amp;fg=ffffff$. Not quite right, but close. If for\u00a0$latex b \\geq 0.5&amp;bg=2a2a2a&amp;fg=ffffff$ you compress the formula for linear dodge on the b-axis by a factor 2 and shift it up that axis by 1\/2, and then also compress the one for linear burn for $latex b \\geq 0.5&amp;bg=2a2a2a&amp;fg=ffffff$ by a factor 2 on the b-axis, you indeed get:\n\n$latex f(a,b) = \\left\\{\\begin{array}{lr} a+2b-1 &amp; \\text{for } b &lt; {1\/2}\\\\ a + 2(b -1\/2) &amp; \\text{for } b \\geq {1\/2} \\end{array} \\right.&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nOr, by resolving the terms, simply:\n\n$latex f(a,b) = a + 2b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n\nThis is no longer commutative in a and b. Swapping the images A and B will yield a different resulting C.\n\nAlong the left edge (a=0) you expect black from the bottom up to b=0.5, then a linear transition to white. On the bottom edge (b=0) just black, because the -1 makes sure all possible results are negative. For b= 1 you get white on the top edge. On the right edge (a=1) you get from b=0 to b=0.5 a linear transition from black to white, above that just white.\n\n[caption id=\"attachment_1685\" align=\"alignnone\" width=\"300\"]<a href=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\"><img class=\"wp-image-1685 size-full\" src=\"http:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Light.png\" alt=\"Linear-Light\" width=\"300\" height=\"300\" \/><\/a> Lineares Licht[\/caption]\n\nOf interest for the PS user is the fact that an image B with $latex b=0.5&amp;bg=2a2a2a&amp;fg=ffffff$ for all pixels transfers image A unchanged to C when combined with this blend mode. $latex b=0.5&amp;bg=2a2a2a&amp;fg=ffffff$ is 50 % grey, which is called the neutral colour for linear light. Linear light is often used to manipulate a photo by using an almost grey layer with only minimal deviations, for example in high-pass sharpening or as one step of the frequency separation method.\n\nLinear light can be described as the sequential execution of linear dodge and linear burn (with B multiplied by 2) or as linear burn with doubled B. The latter unfortunately cannot be recreated in PS, as it would need multiple steps, one of them yielding results outside the allowed interval. Intermediate results would be truncated, the main result would be wrong.\n\n$latex f(a,b)= (a+b) + b - 1 = a + 2b - 1&amp;s=1&amp;bg=2a2a2a&amp;fg=ffffff$\n<h1>Other parts of this mini-series<\/h1>\n<a href=\"\/en\/ps-blend-modes-2\/\">Blend Modes - Part 2: Color Burn, Color Dodge, Screen, Overlay, Hard Light and Vivid Light<\/a>\n\n<a href=\"\/en\/ps-blend-modes-3\/\">Blend Modes - Part 3: Soft Light<\/a>\n<h1>Sources<\/h1>\n<ul>\n \t<li><a title=\"Blend Modes\" href=\"http:\/\/en.wikipedia.org\/wiki\/Blend_modes\" target=\"_blank\" rel=\"noopener\">Wikipedia on Blend Modes<\/a><\/li>\n \t<li><a title=\"Blend effect\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/hh706313%28v=vs.85%29.aspx#sample_code\" target=\"_blank\" rel=\"noopener\">Microsoft Developer Network, DirectX, Direct2D<\/a><\/li>\n \t<li><a title=\"Blend Modes\" href=\"http:\/\/www.pegtop.net\/delphi\/articles\/blendmodes\" target=\"_blank\" rel=\"noopener\">Pegtop<\/a><\/li>\n \t<li><a title=\"How does photoshop blend two images together?\" href=\"http:\/\/stackoverflow.com\/questions\/5919663\/how-does-photoshop-blend-two-images-together\" target=\"_blank\" rel=\"noopener\">Stackoverflow<\/a><\/li>\n \t<li><a title=\"Compositing and Blending\" href=\"http:\/\/www.w3.org\/TR\/compositing-1\/#blending\" target=\"_blank\" rel=\"noopener\">W3C<\/a><\/li>\n<\/ul>","_en_post_name":"ps-blend-modes-1","_en_post_excerpt":"","_en_post_title":"Photoshop Blend Modes - Part 1","edit_language":"en","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[448],"tags":[],"class_list":["post-1655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-methoden"],"jetpack_featured_media_url":"https:\/\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Linear-Burn.png","jetpack_shortlink":"https:\/\/wp.me\/p2DYS2-qH","jetpack_likes_enabled":false,"jetpack-related-posts":[{"id":1746,"url":"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-3\/","url_meta":{"origin":1655,"position":0},"title":"Photoshop Blend Modes - Part 3","author":"zakkinen","date":"20. January 2015","format":false,"excerpt":"Weiches Licht (Soft Light) Soft Light ist die Verrechnungsmethode, \u00fcber die man am h\u00e4ufigsten Fehlerhaftes liest. Was auch daran liegt, dass verschiedene Hersteller die Methode unterschiedlich definieren und so zur Verwirrung beitragen. Ich habe leider noch keine Begr\u00fcndungen f\u00fcr die Wahl der jeweiligen Berechnungen gefunden. Photoshop Mein Photoshop CC verwendet\u2026","rel":"","context":"In &quot;Methods and Techniques&quot;","block_context":{"text":"Methods and Techniques","link":"https:\/\/photo.zakkinen.net\/en\/category\/methods\/"},"img":{"alt_text":"Verlauf A","src":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2015\/01\/EPS-A.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1725,"url":"https:\/\/photo.zakkinen.net\/en\/frequency-separation\/","url_meta":{"origin":1655,"position":1},"title":"Frequency Separation","author":"zakkinen","date":"31. December 2014","format":false,"excerpt":"K\u00fcrzlich habe ich mich mit der Methode der Frequenztrennung zur Retusche besch\u00e4ftigt. Bei den Fstoppers habe ich einen einen interessanten Artikel dazu gefunden, der mich aber mit Fragen zur\u00fcckgelassen hat. Eine war: warum ist Lineares Licht die richtige Verrechnungsmethode f\u00fcr die beiden Ebenen? Und direkt im Anschluss die Fragen, wo\u2026","rel":"","context":"In &quot;Methods and Techniques&quot;","block_context":{"text":"Methods and Techniques","link":"https:\/\/photo.zakkinen.net\/en\/category\/methods\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2014\/12\/Skin-Demo-Final.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1707,"url":"https:\/\/photo.zakkinen.net\/en\/ps-blend-modes-2\/","url_meta":{"origin":1655,"position":2},"title":"Photoshop Blend Modes - Part 2","author":"zakkinen","date":"19. January 2015","format":false,"excerpt":"I already introduced the blend modes Multiplication, Linear Dodge, Linear Burn and Linear Light in the first part of the series. In this article I'll add some more that might be interesting for photographers. For one particular blend mode there is a separate third part, beause it is rather complicated\u2026","rel":"","context":"In &quot;Methods and Techniques&quot;","block_context":{"text":"Methods and Techniques","link":"https:\/\/photo.zakkinen.net\/en\/category\/methods\/"},"img":{"alt_text":"Farbig Nachbelichten","src":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2015\/01\/EPS-ColorBurn.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1172,"url":"https:\/\/photo.zakkinen.net\/en\/korrektur-von-kontrast-und-farbstich-mit-gradationskurven\/","url_meta":{"origin":1655,"position":3},"title":"Korrektur von Kontrast und Farbstich mit Gradationskurven","author":"zakkinen","date":"29. December 2013","format":false,"excerpt":"Ich lese gerade ein Buch von Vincent Versace namens Welcome to Oz 2.0. Schon das erste Kapitel hat mich m\u00e4chtig zum Gr\u00fcbeln gebracht. Ich mag seinen Ansatz, das sorgf\u00e4ltige Vorgehen. Er macht erst einen Plan, stellt sich die Frage, warum er etwas tut, was er erreichen will, bevor er den\u2026","rel":"","context":"In &quot;Methods and Techniques&quot;","block_context":{"text":"Methods and Techniques","link":"https:\/\/photo.zakkinen.net\/en\/category\/methods\/"},"img":{"alt_text":"Meine Aufgabenstellung","src":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2013\/12\/Fehlfarben-1.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2013\/12\/Fehlfarben-1.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2013\/12\/Fehlfarben-1.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2013\/12\/Fehlfarben-1.jpg?resize=700%2C400 2x"},"classes":[]},{"id":1191,"url":"https:\/\/photo.zakkinen.net\/en\/effekte-effekte\/","url_meta":{"origin":1655,"position":4},"title":"Effekte, Effekte!","author":"zakkinen","date":"2. January 2014","format":false,"excerpt":"Vincent Versace, dessen Buch Welcome to Oz 2.0 ich gerade durcharbeite, ist ein gro\u00dfer Freund von vorgefertigten Effekten, z.B. von Nik (jetzt leider Google) oder OnOne. Ich habe bislang immer Abstand genommen von diesen Dingen, weil mir die Ergebnisse immer zu spektakelig daher kamen. Jetzt habe ich probehalber mal angefangen,\u2026","rel":"","context":"In &quot;Methods and Techniques&quot;","block_context":{"text":"Methods and Techniques","link":"https:\/\/photo.zakkinen.net\/en\/category\/methods\/"},"img":{"alt_text":"Party Over","src":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2014\/01\/Party-Over.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2014\/01\/Party-Over.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2014\/01\/Party-Over.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2014\/01\/Party-Over.jpg?resize=700%2C400 2x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2014\/01\/Party-Over.jpg?resize=1050%2C600 3x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2014\/01\/Party-Over.jpg?resize=1400%2C800 4x"},"classes":[]},{"id":1970,"url":"https:\/\/photo.zakkinen.net\/en\/englisches-lightroom-mit-deutscher-tastatur\/","url_meta":{"origin":1655,"position":5},"title":"Englisches Lightroom mit deutscher Tastatur","author":"zakkinen","date":"11. October 2015","format":false,"excerpt":"Mit einem einfachen Trick eine deutsche Tastaturbelegung mit englischem Lightroom benutzen. Die Herausforderung Weil ich bevorzugt englischsprachige Fotoseiten lese und auch eine Menge Foto-Lehrb\u00fccher in dieser Sprache besitze, bevorzuge ich ein englisches Lightroom. So spare ich mir die Suche nach der deutschen Bezeichnung f\u00fcr einen Begriff, der z. B. in\u2026","rel":"","context":"In &quot;Tools&quot;","block_context":{"text":"Tools","link":"https:\/\/photo.zakkinen.net\/en\/category\/tools\/"},"img":{"alt_text":"US Tastaturlayout","src":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2015\/10\/900px-KB_United_States-NoAltGr.svg_.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2015\/10\/900px-KB_United_States-NoAltGr.svg_.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2015\/10\/900px-KB_United_States-NoAltGr.svg_.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/photo.zakkinen.net\/wp-content\/uploads\/2015\/10\/900px-KB_United_States-NoAltGr.svg_.png?resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/posts\/1655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/comments?post=1655"}],"version-history":[{"count":126,"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/posts\/1655\/revisions"}],"predecessor-version":[{"id":6196,"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/posts\/1655\/revisions\/6196"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/media\/1686"}],"wp:attachment":[{"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/media?parent=1655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/categories?post=1655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/photo.zakkinen.net\/en\/wp-json\/wp\/v2\/tags?post=1655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}