Index: app/paint-funcs/paint-funcs-generic.h
===================================================================
--- app/paint-funcs/paint-funcs-generic.h	(revision 25120)
+++ app/paint-funcs/paint-funcs-generic.h	(working copy)
@@ -1613,15 +1613,14 @@ initial_indexed_a_pixels (const guchar *
     {
       gint   col_index = *src++ * 3;
       glong  tmp;
-      guchar new_alpha = INT_MULT3(*src, *m, opacity, tmp);
+      guchar new_alpha = INT_MULT3 (*src, *m, opacity, tmp);
 
       src++;
 
       *dest++ = cmap[col_index++];
       *dest++ = cmap[col_index++];
       *dest++ = cmap[col_index++];
-      /*  Set the alpha channel  */
-      *dest++ = (new_alpha > 127) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
+      *dest++ = new_alpha;
 
       if (mask)
         m++;
Index: app/paint-funcs/paint-funcs.c
===================================================================
--- app/paint-funcs/paint-funcs.c	(revision 25122)
+++ app/paint-funcs/paint-funcs.c	(working copy)
@@ -395,8 +395,7 @@ combine_indexed_a_and_indexed_a_pixels (
           for (b = 0; b < alpha; b++)
             dest[b] = (affect[b] && new_alpha > 127) ? src2[b] : src1[b];
 
-          dest[alpha] = (affect[alpha] && new_alpha > 127) ?
-            OPAQUE_OPACITY : src1[alpha];
+          dest[alpha] = affect[alpha] ? new_alpha : src1[alpha];
 
           m++;
 
@@ -416,8 +415,7 @@ combine_indexed_a_and_indexed_a_pixels (
           for (b = 0; b < alpha; b++)
             dest[b] = (affect[b] && new_alpha > 127) ? src2[b] : src1[b];
 
-          dest[alpha] = (affect[alpha] && new_alpha > 127) ?
-            OPAQUE_OPACITY : src1[alpha];
+          dest[alpha] = affect[alpha] ? new_alpha : src1[alpha];
 
           src1 += bytes;
           src2 += bytes;
@@ -451,10 +449,9 @@ combine_inten_a_and_indexed_pixels (cons
           guint           b;
 
           for (b = 0; b < bytes - 1; b++)
-            dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
+            dest[b] = INT_BLEND (cmap[index + b], src1[b], new_alpha, tmp);
 
-          dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b];
-          /*  alpha channel is opaque  */
+          dest[b] = new_alpha;
 
           m++;
 
@@ -473,10 +470,9 @@ combine_inten_a_and_indexed_pixels (cons
           guint           b;
 
           for (b = 0; b < bytes - 1; b++)
-            dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
+            dest[b] = INT_BLEND (cmap[index + b], src1[b], new_alpha, tmp);
 
-          dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b];
-          /*  alpha channel is opaque  */
+          dest[b] = new_alpha;
 
           src1 += bytes;
           src2 += src2_bytes;
@@ -511,10 +507,9 @@ combine_inten_a_and_indexed_a_pixels (co
           guint           b;
 
           for (b = 0; b < bytes - 1; b++)
-            dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
+            dest[b] = INT_BLEND (cmap[index + b], src1[b], new_alpha, tmp);
 
-          dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b];
-          /*  alpha channel is opaque  */
+          dest[b] = new_alpha;
 
           m++;
 
@@ -533,10 +528,9 @@ combine_inten_a_and_indexed_a_pixels (co
           guint           b;
 
           for (b = 0; b < bytes - 1; b++)
-            dest[b] = (new_alpha > 127) ? cmap[index + b] : src1[b];
+            dest[b] = INT_BLEND (cmap[index + b], src1[b], new_alpha, tmp);
 
-          dest[b] = (new_alpha > 127) ? OPAQUE_OPACITY : src1[b];
-          /*  alpha channel is opaque  */
+          dest[b] = new_alpha;
 
           src1 += bytes;
           src2 += src2_bytes;
@@ -1369,8 +1363,8 @@ behind_indexed_pixels (const guchar   *s
     {
       guchar src1_alpha = src1[alpha];
       guchar src2_alpha = INT_MULT3 (src2[alpha], *m, opacity, tmp);
-      guchar new_alpha  =
-        (src2_alpha > 127) ? OPAQUE_OPACITY : TRANSPARENT_OPACITY;
+      guchar new_alpha  = (src2_alpha > 127 ?
+                           OPAQUE_OPACITY : TRANSPARENT_OPACITY);
 
       for (b = 0; b < bytes1; b++)
         dest[b] =
Index: app/paint-funcs/subsample-region.c
===================================================================
--- app/paint-funcs/subsample-region.c	(revision 25120)
+++ app/paint-funcs/subsample-region.c	(working copy)
@@ -343,15 +343,13 @@ subsample_indexed_region (PixelRegion  *
           /*  transform the color to RGB  */
           if (has_alpha)
             {
-              if (s[ALPHA_I_PIX] & 0x80)
-                {
-                  r[RED_PIX]   += cmap[index++] * tot_frac;
-                  r[GREEN_PIX] += cmap[index++] * tot_frac;
-                  r[BLUE_PIX]  += cmap[index++] * tot_frac;
-                  r[ALPHA_PIX] += tot_frac;
-                }
-              /* else the pixel contributes nothing and needs not to be added
-               */
+              /* premultiply */
+              gdouble local_frac = tot_frac * (gdouble) s[1] / 255.0;
+
+              r[RED_PIX]   += cmap[index++] * local_frac;
+              r[GREEN_PIX] += cmap[index++] * local_frac;
+              r[BLUE_PIX]  += cmap[index++] * local_frac;
+              r[ALPHA_PIX] += local_frac;
             }
           else
             {
