[gimp/pippin/linear-is-the-new-black] app: gimp_composite_blend - add compositing space argument



commit 16925db68efd60a2103f82f4fe736d64b070f210
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jan 17 01:13:33 2017 +0100

    app: gimp_composite_blend - add compositing space argument

 app/operations/layer-modes/gimpoperationaddition.c |    1 +
 app/operations/layer-modes/gimpoperationburn.c     |    1 +
 .../layer-modes/gimpoperationdarkenonly.c          |    1 +
 .../layer-modes/gimpoperationdifference.c          |    1 +
 app/operations/layer-modes/gimpoperationdivide.c   |    1 +
 app/operations/layer-modes/gimpoperationdodge.c    |    1 +
 .../layer-modes/gimpoperationgrainextract.c        |    1 +
 .../layer-modes/gimpoperationgrainmerge.c          |    1 +
 .../layer-modes/gimpoperationhardlight.c           |    1 +
 app/operations/layer-modes/gimpoperationhsvcolor.c |    1 +
 app/operations/layer-modes/gimpoperationhsvhue.c   |    1 +
 .../layer-modes/gimpoperationhsvsaturation.c       |    1 +
 app/operations/layer-modes/gimpoperationhsvvalue.c |    1 +
 .../layer-modes/gimpoperationlchchroma.c           |    1 +
 app/operations/layer-modes/gimpoperationlchcolor.c |    1 +
 app/operations/layer-modes/gimpoperationlchhue.c   |    1 +
 .../layer-modes/gimpoperationlchlightness.c        |    1 +
 .../layer-modes/gimpoperationlightenonly.c         |    1 +
 app/operations/layer-modes/gimpoperationmultiply.c |    1 +
 app/operations/layer-modes/gimpoperationoverlay.c  |   57 ++--------------
 .../layer-modes/gimpoperationpointlayermode.h      |   71 ++++++++++++++++++-
 app/operations/layer-modes/gimpoperationscreen.c   |    1 +
 .../layer-modes/gimpoperationsoftlight.c           |    1 +
 app/operations/layer-modes/gimpoperationsubtract.c |    1 +
 24 files changed, 97 insertions(+), 53 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpoperationaddition.c 
b/app/operations/layer-modes/gimpoperationaddition.c
index 922bf24..0d6c2e6 100644
--- a/app/operations/layer-modes/gimpoperationaddition.c
+++ b/app/operations/layer-modes/gimpoperationaddition.c
@@ -92,6 +92,7 @@ gimp_operation_addition_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_addition
      );
diff --git a/app/operations/layer-modes/gimpoperationburn.c b/app/operations/layer-modes/gimpoperationburn.c
index 080a5e6..3cffe69 100644
--- a/app/operations/layer-modes/gimpoperationburn.c
+++ b/app/operations/layer-modes/gimpoperationburn.c
@@ -94,6 +94,7 @@ gimp_operation_burn_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_burn
      );
diff --git a/app/operations/layer-modes/gimpoperationdarkenonly.c 
b/app/operations/layer-modes/gimpoperationdarkenonly.c
index 869c6d8..0eae2d9 100644
--- a/app/operations/layer-modes/gimpoperationdarkenonly.c
+++ b/app/operations/layer-modes/gimpoperationdarkenonly.c
@@ -93,6 +93,7 @@ gimp_operation_darken_only_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_LINEAR,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_darken_only
      );
diff --git a/app/operations/layer-modes/gimpoperationdifference.c 
b/app/operations/layer-modes/gimpoperationdifference.c
index 6b30f29..ae5d697 100644
--- a/app/operations/layer-modes/gimpoperationdifference.c
+++ b/app/operations/layer-modes/gimpoperationdifference.c
@@ -93,6 +93,7 @@ gimp_operation_difference_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_difference
      );
diff --git a/app/operations/layer-modes/gimpoperationdivide.c 
b/app/operations/layer-modes/gimpoperationdivide.c
index 4bb47f7..92014b0 100644
--- a/app/operations/layer-modes/gimpoperationdivide.c
+++ b/app/operations/layer-modes/gimpoperationdivide.c
@@ -93,6 +93,7 @@ gimp_operation_divide_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_divide
      );
diff --git a/app/operations/layer-modes/gimpoperationdodge.c b/app/operations/layer-modes/gimpoperationdodge.c
index 8c5da9b..1097ece 100644
--- a/app/operations/layer-modes/gimpoperationdodge.c
+++ b/app/operations/layer-modes/gimpoperationdodge.c
@@ -93,6 +93,7 @@ gimp_operation_dodge_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_dodge
      );
diff --git a/app/operations/layer-modes/gimpoperationgrainextract.c 
b/app/operations/layer-modes/gimpoperationgrainextract.c
index 36539e3..6d89d57 100644
--- a/app/operations/layer-modes/gimpoperationgrainextract.c
+++ b/app/operations/layer-modes/gimpoperationgrainextract.c
@@ -93,6 +93,7 @@ gimp_operation_grain_extract_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_grain_extract
      );
diff --git a/app/operations/layer-modes/gimpoperationgrainmerge.c 
b/app/operations/layer-modes/gimpoperationgrainmerge.c
index 1c079b5..8102164 100644
--- a/app/operations/layer-modes/gimpoperationgrainmerge.c
+++ b/app/operations/layer-modes/gimpoperationgrainmerge.c
@@ -93,6 +93,7 @@ gimp_operation_grain_merge_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_grain_merge
      );
diff --git a/app/operations/layer-modes/gimpoperationhardlight.c 
b/app/operations/layer-modes/gimpoperationhardlight.c
index a1f83b4..fa410ad 100644
--- a/app/operations/layer-modes/gimpoperationhardlight.c
+++ b/app/operations/layer-modes/gimpoperationhardlight.c
@@ -92,6 +92,7 @@ gimp_operation_hardlight_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_hardlight
      );
diff --git a/app/operations/layer-modes/gimpoperationhsvcolor.c 
b/app/operations/layer-modes/gimpoperationhsvcolor.c
index 6c9b0f9..3b2e182 100644
--- a/app/operations/layer-modes/gimpoperationhsvcolor.c
+++ b/app/operations/layer-modes/gimpoperationhsvcolor.c
@@ -97,6 +97,7 @@ gimp_operation_hsv_color_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_hsv_color
      );
diff --git a/app/operations/layer-modes/gimpoperationhsvhue.c 
b/app/operations/layer-modes/gimpoperationhsvhue.c
index da18bd2..92603cc 100644
--- a/app/operations/layer-modes/gimpoperationhsvhue.c
+++ b/app/operations/layer-modes/gimpoperationhsvhue.c
@@ -97,6 +97,7 @@ gimp_operation_hsv_hue_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_hsv_hue
      );
diff --git a/app/operations/layer-modes/gimpoperationhsvsaturation.c 
b/app/operations/layer-modes/gimpoperationhsvsaturation.c
index 24a18db..1cba1b7 100644
--- a/app/operations/layer-modes/gimpoperationhsvsaturation.c
+++ b/app/operations/layer-modes/gimpoperationhsvsaturation.c
@@ -97,6 +97,7 @@ gimp_operation_hsv_saturation_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_hsv_saturation
      );
diff --git a/app/operations/layer-modes/gimpoperationhsvvalue.c 
b/app/operations/layer-modes/gimpoperationhsvvalue.c
index 87276eb..3843bdb 100644
--- a/app/operations/layer-modes/gimpoperationhsvvalue.c
+++ b/app/operations/layer-modes/gimpoperationhsvvalue.c
@@ -97,6 +97,7 @@ gimp_operation_hsv_value_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_hsv_value
      );
diff --git a/app/operations/layer-modes/gimpoperationlchchroma.c 
b/app/operations/layer-modes/gimpoperationlchchroma.c
index 71ce2dd..7a8c705 100644
--- a/app/operations/layer-modes/gimpoperationlchchroma.c
+++ b/app/operations/layer-modes/gimpoperationlchchroma.c
@@ -160,6 +160,7 @@ gimp_operation_lch_chroma_process_pixels_linear (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_LAB,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_lch_chroma
      );
diff --git a/app/operations/layer-modes/gimpoperationlchcolor.c 
b/app/operations/layer-modes/gimpoperationlchcolor.c
index 004d4b4..3985422 100644
--- a/app/operations/layer-modes/gimpoperationlchcolor.c
+++ b/app/operations/layer-modes/gimpoperationlchcolor.c
@@ -154,6 +154,7 @@ gimp_operation_lch_color_process_pixels_linear (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_LAB,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_lch_color
      );
diff --git a/app/operations/layer-modes/gimpoperationlchhue.c 
b/app/operations/layer-modes/gimpoperationlchhue.c
index 36ef390..ea21e0b 100644
--- a/app/operations/layer-modes/gimpoperationlchhue.c
+++ b/app/operations/layer-modes/gimpoperationlchhue.c
@@ -162,6 +162,7 @@ gimp_operation_lch_hue_process_pixels_linear (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_LAB,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_lch_hue
      );
diff --git a/app/operations/layer-modes/gimpoperationlchlightness.c 
b/app/operations/layer-modes/gimpoperationlchlightness.c
index b31c9a3..c9bc3b5 100644
--- a/app/operations/layer-modes/gimpoperationlchlightness.c
+++ b/app/operations/layer-modes/gimpoperationlchlightness.c
@@ -151,6 +151,7 @@ gimp_operation_lch_lightness_process_pixels_linear (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_LAB,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_lch_lightness
      );
diff --git a/app/operations/layer-modes/gimpoperationlightenonly.c 
b/app/operations/layer-modes/gimpoperationlightenonly.c
index 0f101ef..a67e7f0 100644
--- a/app/operations/layer-modes/gimpoperationlightenonly.c
+++ b/app/operations/layer-modes/gimpoperationlightenonly.c
@@ -93,6 +93,7 @@ gimp_operation_lighten_only_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_LINEAR,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_lighten_only
      );
diff --git a/app/operations/layer-modes/gimpoperationmultiply.c 
b/app/operations/layer-modes/gimpoperationmultiply.c
index dcd5a68..4367062 100644
--- a/app/operations/layer-modes/gimpoperationmultiply.c
+++ b/app/operations/layer-modes/gimpoperationmultiply.c
@@ -93,6 +93,7 @@ gimp_operation_multiply_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_multiply
      );
diff --git a/app/operations/layer-modes/gimpoperationoverlay.c 
b/app/operations/layer-modes/gimpoperationoverlay.c
index ca67587..34229a7 100644
--- a/app/operations/layer-modes/gimpoperationoverlay.c
+++ b/app/operations/layer-modes/gimpoperationoverlay.c
@@ -89,54 +89,13 @@ gimp_operation_overlay_process_pixels (gfloat              *in,
                                        const GeglRectangle *roi,
                                        gint                 level)
 {
-  const gboolean has_mask = mask != NULL;
-
-  while (samples--)
-    {
-      gfloat comp_alpha, new_alpha;
-
-      comp_alpha = layer[ALPHA] * opacity;
-      if (has_mask)
-        comp_alpha *= *mask;
-
-      new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
-
-      if (comp_alpha && new_alpha)
-        {
-          gint   b;
-          gfloat ratio = comp_alpha / new_alpha;
-
-          for (b = RED; b < ALPHA; b++)
-            {
-              gfloat comp;
-
-              if (in[b] < 0.5)
-                comp = 2.0 * in[b] * layer[b];
-              else
-                comp = 1.0 - 2.0 * (1.0 - layer[b]) * (1.0 - in[b]);
-
-              out[b] = comp * ratio + in[b] * (1.0 - ratio);
-            }
-        }
-      else
-        {
-          gint b;
-
-          for (b = RED; b < ALPHA; b++)
-            {
-              out[b] = in[b];
-            }
-        }
-
-      out[ALPHA] = in[ALPHA];
-
-      in    += 4;
-      layer += 4;
-      out   += 4;
-
-      if (has_mask)
-        mask++;
-    }
-
+  gimp_composite_blend (
+     in, layer, mask, out, opacity, samples,
+     GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
+     GIMP_LAYER_COMPOSITE_SRC_ATOP,
+     blendfun_overlay
+     );
   return TRUE;
 }
+
diff --git a/app/operations/layer-modes/gimpoperationpointlayermode.h 
b/app/operations/layer-modes/gimpoperationpointlayermode.h
index 1b6bd25..ef26b3b 100644
--- a/app/operations/layer-modes/gimpoperationpointlayermode.h
+++ b/app/operations/layer-modes/gimpoperationpointlayermode.h
@@ -105,6 +105,7 @@ gimp_composite_blend (gfloat              *in,
                       gfloat               opacity,
                       glong                samples,
                       GimpBlendBlend       blend_trc,
+                      GimpBlendBlend       composite_trc,
                       GimpLayerComposite   composite_mode,
                       void (*blendfun) (const float *dst,
                                         const float *src,
@@ -117,7 +118,20 @@ gimp_composite_blend (gfloat              *in,
  
   if (blendfun == NULL)
   {
-     blend_out = layer;
+     switch (composite_trc)
+     {
+       case GIMP_LAYER_BLEND_RGB_LINEAR:
+         blend_out = layer;
+         break;
+       case GIMP_LAYER_BLEND_LAB:
+         blend_out = alloca (sizeof (gfloat) * 4 * samples);
+         babl_process (_gimp_fish_rgba_to_laba, layer, blend_out, samples);
+         break;
+       case GIMP_LAYER_BLEND_RGB_PERCEPTUAL:
+         blend_out = alloca (sizeof (gfloat) * 4 * samples);
+         babl_process (_gimp_fish_rgba_to_perceptual, layer, blend_out, samples);
+         break;
+     }
   }
   else if (blend_trc == GIMP_LAYER_BLEND_RGB_LINEAR)
   {
@@ -125,6 +139,18 @@ gimp_composite_blend (gfloat              *in,
       blend_out = alloca (sizeof (gfloat) * 4 * samples);
 
     blendfun (blend_in, blend_layer, blend_out, samples);
+
+    switch (composite_trc)
+    {
+      case GIMP_LAYER_BLEND_RGB_LINEAR:
+        break;
+      case GIMP_LAYER_BLEND_LAB:
+        babl_process (_gimp_fish_rgba_to_laba, blend_out, blend_out, samples);
+        break;
+      case GIMP_LAYER_BLEND_RGB_PERCEPTUAL:
+        babl_process (_gimp_fish_rgba_to_perceptual, blend_out, blend_out, samples);
+        break;
+    }
   }
   else if (blend_trc == GIMP_LAYER_BLEND_RGB_PERCEPTUAL)
   {
@@ -139,7 +165,19 @@ gimp_composite_blend (gfloat              *in,
  
     blendfun (blend_in, blend_layer, blend_out, samples);
  
-    babl_process (_gimp_fish_perceptual_to_rgba, blend_out, blend_out, samples);
+    switch (composite_trc)
+    {
+      case GIMP_LAYER_BLEND_RGB_LINEAR:
+        babl_process (_gimp_fish_perceptual_to_rgba, blend_out, blend_out, samples);
+        break;
+      case GIMP_LAYER_BLEND_LAB:
+        babl_process (_gimp_fish_perceptual_to_rgba, blend_out, blend_out, samples);
+        // XXX : double conversion - could be avoided with custom fish
+        babl_process (_gimp_fish_rgba_to_laba, blend_out, blend_out, samples);
+        break;
+      case GIMP_LAYER_BLEND_RGB_PERCEPTUAL:
+        break;
+    }
   }
   else if (blend_trc == GIMP_LAYER_BLEND_LAB)
   {
@@ -151,8 +189,19 @@ gimp_composite_blend (gfloat              *in,
       blend_out   = alloca (sizeof (gfloat) * 4 * samples);
  
     blendfun (blend_in, blend_layer, blend_out, samples);
- 
-    babl_process (_gimp_fish_laba_to_rgba, blend_out, blend_out, samples);
+
+    switch (composite_trc)
+    {
+      case GIMP_LAYER_BLEND_RGB_LINEAR:
+        babl_process (_gimp_fish_laba_to_rgba, blend_out, blend_out, samples);
+        break;
+      case GIMP_LAYER_BLEND_LAB:
+        break;
+      case GIMP_LAYER_BLEND_RGB_PERCEPTUAL:
+        babl_process (_gimp_fish_laba_to_rgba, blend_out, blend_out, samples);
+        babl_process (_gimp_fish_perceptual_to_rgba, blend_out, blend_out, samples);
+        break;
+    }
   }
  
   switch (composite_mode)
@@ -284,6 +333,20 @@ gimp_composite_blend (gfloat              *in,
         }
       break;
   }
+
+  switch (composite_trc)
+  {
+    case GIMP_LAYER_BLEND_RGB_LINEAR:
+      break;
+    case GIMP_LAYER_BLEND_LAB:
+      out -= 4 * samples;
+      babl_process (_gimp_fish_laba_to_rgba, out, out, samples);
+      break;
+    case GIMP_LAYER_BLEND_RGB_PERCEPTUAL:
+      out -= 4 * samples;
+      babl_process (_gimp_fish_perceptual_to_rgba, out, out, samples);
+      break;
+  }
 }
  
 static inline void
diff --git a/app/operations/layer-modes/gimpoperationscreen.c 
b/app/operations/layer-modes/gimpoperationscreen.c
index 011ad3f..2c1451f 100644
--- a/app/operations/layer-modes/gimpoperationscreen.c
+++ b/app/operations/layer-modes/gimpoperationscreen.c
@@ -93,6 +93,7 @@ gimp_operation_screen_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_screen
      );
diff --git a/app/operations/layer-modes/gimpoperationsoftlight.c 
b/app/operations/layer-modes/gimpoperationsoftlight.c
index ec4ad81..3020acd 100644
--- a/app/operations/layer-modes/gimpoperationsoftlight.c
+++ b/app/operations/layer-modes/gimpoperationsoftlight.c
@@ -110,6 +110,7 @@ gimp_operation_softlight_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_softlight
      );
diff --git a/app/operations/layer-modes/gimpoperationsubtract.c 
b/app/operations/layer-modes/gimpoperationsubtract.c
index b97f17c..90ade4e 100644
--- a/app/operations/layer-modes/gimpoperationsubtract.c
+++ b/app/operations/layer-modes/gimpoperationsubtract.c
@@ -93,6 +93,7 @@ gimp_operation_subtract_process_pixels (gfloat              *in,
   gimp_composite_blend (
      in, layer, mask, out, opacity, samples,
      GIMP_LAYER_BLEND_RGB_PERCEPTUAL,
+     GIMP_LAYER_BLEND_RGB_LINEAR,
      GIMP_LAYER_COMPOSITE_SRC_ATOP,
      blendfun_subtract
      );


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]