When creating text within a white background, text shadow gets badly shaped (at least for me). To solve it, i rewrote the "Color->getIndex()" function. It works fine for me now:
/**
* @param resource $image GD image resource
* @return int Returns the index of the specified color+alpha in the palette of the image,
* or -1 if the color does not exist in the image's palette.
*/
public function getIndex($image)
{
$color = -1;
if ($this->hasAlphaChannel()) {
if(($color = imagecolorexactalpha(
$image,
$this->red,
$this->green,
$this->blue,
$this->alpha
)) == -1){
$color = imagecolorallocatealpha(
$image,
$this->red,
$this->green,
$this->blue,
$this->alpha
);
}
} else {
if(($color = imagecolorexact(
$image,
$this->red,
$this->green,
$this->blue
)) == -1){
$color = imagecolorallocate(
$image,
$this->red,
$this->green,
$this->blue
);
}
}
return $color;
}
Hi,
When creating text within a white background, text shadow gets badly shaped (at least for me). To solve it, i rewrote the "Color->getIndex()" function. It works fine for me now:
Before
After