Bug 759796 - Blend tool regression

We must not dither the alpha channel if it is fully opaque or fully
transparent. 2.8 did the same but the dithering of these values was
apparently consumed be putting the result into 8 bit values.
This commit is contained in:
Michael Natterer 2016-04-17 01:06:08 +01:00
parent d9e608f722
commit 5730278eeb

View file

@ -944,7 +944,11 @@ gradient_put_pixel (gint x,
r = color->r + (gdouble) (i & 0xff) / 256.0 / 256.0; i >>= 8;
g = color->g + (gdouble) (i & 0xff) / 256.0 / 256.0; i >>= 8;
b = color->b + (gdouble) (i & 0xff) / 256.0 / 256.0; i >>= 8;
a = color->a + (gdouble) (i & 0xff) / 256.0 / 256.0;
if (color->a > 0.0 && color->a < 1.0)
a = color->a + (gdouble) (i & 0xff) / 256.0 / 256.0;
else
a = color->a;
*dest++ = MAX (r, 0.0);
*dest++ = MAX (g, 0.0);
@ -1119,7 +1123,11 @@ gimp_operation_blend_process (GeglOperation *operation,
r = color.r + (gdouble) (i & 0xff) / 256.0 / 256.0; i >>= 8;
g = color.g + (gdouble) (i & 0xff) / 256.0 / 256.0; i >>= 8;
b = color.b + (gdouble) (i & 0xff) / 256.0 / 256.0; i >>= 8;
a = color.a + (gdouble) (i & 0xff) / 256.0 / 256.0;
if (color.a > 0.0 && color.a < 1.0)
a = color.a + (gdouble) (i & 0xff) / 256.0 / 256.0;
else
a = color.a;
*dest++ = MAX (r, 0.0);
*dest++ = MAX (g, 0.0);