imagefilter оставляет края не полностью покрытыми

У меня есть черный логотип, который окрашивается с помощью следующего кода

/**
* Adds the logo to the image, and colours it if the colour isnt black
*/

public function addLogo($color = 'FFFFFF'){

// Future note: The logo has to be black to have it's colour changed. White logo's don't work.
$logoImage = imagecreatefrompng(APPLICATION_PATH . '/../public_html/images/widget/overlay/JSLogo2.png');

// If a hex is passed, and it's not black, colour the logo.
if($color != null && $color != '000000'){
imagefilter($logoImage, IMG_FILTER_COLORIZE, hexdec('0x' . $color{0} . $color{1}), hexdec('0x' . $color{2} . $color{3}), hexdec('0x' . $color{4} . $color{5}));
}

// Get the offset.
$offset = $this->getPadding() + $this->_circleWidth + (5 * $this->_scaleFactor);

imagecopyresampled(
$this->getImage(),
$logoImage,
$offset,
($this->_scaleFactor * $this->_padding),
0,
0,
$this->_logoWidth,
$this->_logoHeight,
$this->_oriLogoWidth,
$this->_oriLogoHeight
);

imagedestroy($logoImage);

return $this;
}

Вывод окрашивает большую часть изображения, но оставляет края. Можно ли как-то улучшить покрытие цвета или это лучшее, что сможет сделать PHP? Ниже приведен скриншот вывода. Тот же эффект происходит с любым цветом логотипа и фона.

введите описание изображения здесь

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector