Файл: vendor/intervention/image/src/Drivers/Gd/Modifiers/BlendTransparencyModifier.php
Строк: 63
<?php
declare(strict_types=1);
namespace InterventionImageDriversGdModifiers;
use InterventionImageDriversGdCloner;
use InterventionImageInterfacesImageInterface;
use InterventionImageInterfacesSpecializedInterface;
use InterventionImageModifiersBlendTransparencyModifier as GenericBlendTransparencyModifier;
class BlendTransparencyModifier extends GenericBlendTransparencyModifier implements SpecializedInterface
{
/**
* {@inheritdoc}
*
* @see ModifierInterface::apply()
*/
public function apply(ImageInterface $image): ImageInterface
{
$blendingColor = $this->blendingColor($this->driver());
foreach ($image as $frame) {
// create new canvas with blending color as background
$modified = Cloner::cloneBlended(
$frame->native(),
background: $blendingColor
);
// set new gd image
$frame->setNative($modified);
}
return $image;
}
}