Commit 33b05cd3 authored by Ell's avatar Ell

Bug 786844 - Issue with grain merge layer mode

Use 128/255, rather than 0.5, as the half-intensity value for
legacy layer modes that use it explicitly, to match 2.8 results.
parent 7da0153f
......@@ -95,7 +95,7 @@ gimp_operation_grain_extract_legacy_process (GeglOperation *op,
for (b = RED; b < ALPHA; b++)
{
gfloat comp = in[b] - layer[b] + 0.5;
gfloat comp = in[b] - layer[b] + 128.0 / 255.0;
out[b] = comp * ratio + in[b] * (1.0 - ratio);
out[b] = CLAMP (out[b], 0.0, 1.0);
......
......@@ -95,7 +95,7 @@ gimp_operation_grain_merge_legacy_process (GeglOperation *op,
for (b = RED; b < ALPHA; b++)
{
gfloat comp = in[b] + layer[b] - 0.5;
gfloat comp = in[b] + layer[b] - 128.0 / 255.0;
out[b] = comp * ratio + in[b] * (1.0 - ratio);
out[b] = CLAMP (out[b], 0.0, 1.0);
......
......@@ -97,9 +97,9 @@ gimp_operation_hardlight_legacy_process (GeglOperation *op,
{
gfloat comp;
if (layer[b] > 0.5)
if (layer[b] > 128.0 / 255.0)
{
comp = (1.0 - in[b]) * (1.0 - (layer[b] - 0.5) * 2.0);
comp = (1.0 - in[b]) * (1.0 - (layer[b] - 128.0 / 255.0) * 2.0);
comp = MIN (1 - comp, 1);
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment