[gimp] Fix the vivid light formula
- From: Alexandre Prokoudine <aprokoudine src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Fix the vivid light formula
- Date: Sat, 4 Feb 2017 20:00:32 +0000 (UTC)
commit 0159d0b73436a8001b70bf15d131ac069311920d
Author: Alexandre Prokoudine <alexandre prokoudine gmail com>
Date: Sat Feb 4 22:58:35 2017 +0300
Fix the vivid light formula
.../layer-modes/gimpoperationlayermode.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpoperationlayermode.c
b/app/operations/layer-modes/gimpoperationlayermode.c
index 263b58a..1274f88 100644
--- a/app/operations/layer-modes/gimpoperationlayermode.c
+++ b/app/operations/layer-modes/gimpoperationlayermode.c
@@ -1726,7 +1726,7 @@ blendfun_copy (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_vivid_light (const float *dest,
const float *src,
@@ -1743,13 +1743,13 @@ blendfun_vivid_light (const float *dest,
{
gfloat comp;
- if (src[c] > 0.5f)
+ if (src[c] <= 0.5f)
{
- comp = (1.0f - (1.0f - dest[c]) / (2.0f * (src[c])));
+ comp = 1.0f - (1.0f - dest[c]) / (2.0f * (src[c]));
}
else
{
- comp = dest[c] / (1.0f - 2.0f * (src[c] - 0.5));
+ comp = dest[c] / (2.0f * (1.0f - src[c]));
}
comp = MIN (comp, 1.0f);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]