[gimp] Fix the linear light layer mode formula
- From: Alexandre Prokoudine <aprokoudine src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Fix the linear light layer mode formula
- Date: Sat, 4 Feb 2017 22:20:08 +0000 (UTC)
commit e69924b4eb2c1d13c03616fa5fd9bdc2eae2a4aa
Author: Alexandre Prokoudine <alexandre prokoudine gmail com>
Date: Sun Feb 5 01:17:33 2017 +0300
Fix the linear light layer mode formula
This simpler version provides the rendering that matches
Photoshop's one.
.../layer-modes/gimpoperationlayermode.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpoperationlayermode.c
b/app/operations/layer-modes/gimpoperationlayermode.c
index 01b1297..9b11bcf 100644
--- a/app/operations/layer-modes/gimpoperationlayermode.c
+++ b/app/operations/layer-modes/gimpoperationlayermode.c
@@ -1766,7 +1766,7 @@ blendfun_vivid_light (const float *dest,
/* added according to:
- http://www.deepskycolors.com/archivo/2010/04/21/formulas-for-Photoshop-blending-modes.html */
+ http://www.simplefilter.de/en/basics/mixmods.html */
static inline void
blendfun_linear_light (const float *dest,
const float *src,
@@ -1782,14 +1782,7 @@ blendfun_linear_light (const float *dest,
for (c = 0; c < 3; c++)
{
gfloat comp;
- if (src[c] > 0.5f)
- {
- comp = dest[c] + 2.0 * (src[c] - 0.5);
- }
- else
- {
- comp = dest[c] + 2.0 * src[c] - 1.0;
- }
+ comp = dest[c] + 2.0f * src[c] - 1.0f;
out[c] = comp;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]