Re: What's wrong with transparency by GD?



On Apr 30, 11:20 am, "Ela" <e...@xxxxxxxxxx> wrote:
"Blending mode is not available when drawing on palette images."
You need to be in true color mode, the default is palette mode.
--S

You're correct. But why does color mode change lead to background
blackening?

New questions should go in new threads.

You need to initialize the background.

# Draw a transparent background
$bkg = $im->colorAllocateAlpha(0,0,0,127);
$im->transparent($bkg);
$im->alphaBlending(0); # replace pixels
$im->filledRectangle(0,0,549,449,$bkg);

# Now draw with blending
$im->alphaBlending(1);

now draw your circles

.