Re: What's wrong with transparency by GD?
- From: smallpond <smallpond@xxxxxxxx>
- Date: Wed, 30 Apr 2008 07:11:03 -0700 (PDT)
On Apr 30, 4:05 am, "Ela" <e...@xxxxxxxxxx> wrote:
After testing different parameters, I'm still unable to obtain 2 transparent
circles. Could anybody tell me what's wrong in the following codes?
#!/usr/bin/perl
use GD;
$im = new GD::Image(550,450);
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocateAlpha(255,0,0,119);
$blue = $im->colorAllocateAlpha(0,0,255,119);
$im->transparent($white);
$im->alphaBlending(1);
$im->setStyle($black);
$im->filledArc(460,380,95,75,0,360,$red);
$im->filledArc(500,380,95,75,0,360,$blue);
open(IMG, ">test.png");
binmode IMG;
print IMG $im->png;
close IMG;
"Blending mode is not available when drawing on palette images."
You need to be in true color mode, the default is palette mode.
--S
.
- Follow-Ups:
- References:
- What's wrong with transparency by GD?
- From: Ela
- What's wrong with transparency by GD?
- Prev by Date: Re: Pipe and Par questions
- Next by Date: Re: What's wrong with transparency by GD?
- Previous by thread: What's wrong with transparency by GD?
- Next by thread: Re: What's wrong with transparency by GD?
- Index(es):