• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/File/Image/Gd.php
  • Класс: BitrixMainFileImageGd
  • Вызов: Gd::restoreTransparency
protected function restoreTransparency($transparentColor)
{
	imagecolortransparent($this->resource, $transparentColor);

	$width = $this->getWidth();
	$height = $this->getHeight();

	for ($y = 0; $y < $height; ++$y)
	{
		for ($x = 0; $x < $width; ++$x)
		{
			if (((imagecolorat($this->resource, $x, $y) >> 24) & 0x7F) >= 100)
			{
				imagesetpixel($this->resource,	$x,	$y,	$transparentColor);
			}
		}
	}
}