Commit 0a175463 authored by William Skaggs's avatar William Skaggs
Browse files

Bill Skaggs <weskaggs@primate.ucdavis.edu>

	* app/core/gimpimage-convert.c
	(median_cut_pass2_nodestruct_dither_rgb): adjust alpha-dithering
	and make code more readable; fixes bug #358851 as suggested
	by Tor Lillqvist.
parent c6ae0a79
2006-10-03 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpimage-convert.c
(median_cut_pass2_nodestruct_dither_rgb): adjust alpha-dithering
and make code more readable; fixes bug #358851 as suggested
by Tor Lillqvist.
2006-10-03 Michael Natterer <mitch@gimp.org>
 
* app/core/gimppalette-load.[ch]: added
......
......@@ -3291,10 +3291,26 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
{
for (col = 0; col < srcPR.w; col++)
{
if ((has_alpha && (alpha_dither ?
((src[alpha_pix]) > (DM[(col+srcPR.x+offsetx)&DM_WIDTHMASK][(row+srcPR.y+offsety)&DM_HEIGHTMASK])) :
(src[alpha_pix] > 127)))
|| !has_alpha)
gboolean transparent = FALSE;
if (has_alpha)
{
if (alpha_dither)
{
gint dither_x = (col + srcPR.x + offsetx) & DM_WIDTHMASK;
gint dither_y = (row + srcPR.y + offsety) & DM_HEIGHTMASK;
if ((src[alpha_pix]) < DM[dither_x][dither_y])
transparent = TRUE;
}
else
{
if (src[alpha_pix] < 128)
transparent = TRUE;
}
}
if (! transparent)
{
if ((lastred == src[red_pix]) &&
(lastgreen == src[green_pix]) &&
......
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