imagesavealpha

Supported Versions: PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8
Whether to retain full alpha channel information when saving PNG images
imagesavealpha(GdImage $imagebool $enable): bool
            imagecolortransparent($modified$transColor);

        } else {

            
imagealphablending($modifiedfalse);

            
imagesavealpha($modifiedtrue);

        }
        $height imagesy($core);

        
$clone imagecreatetruecolor($width$height);

        
imagealphablending($clonefalse);

        
imagesavealpha($clonetrue);

        
$transparency imagecolorallocatealpha($clone000127);

        
imagefill($clone00$transparency);

        
        ob_start();

        
$resource $this->image->getCore();

        
imagealphablending($resourcefalse);

        
imagesavealpha($resourcetrue);

        
imagepng($resourcenull, -1);

        
$this->image->mime image_type_to_mime_type(IMAGETYPE_PNG);

        
$buffer ob_get_contents();
        ob_start();

        
imagepalettetotruecolor($this->image->getCore());

        
imagealphablending($this->image->getCore(), true);

        
imagesavealpha($this->image->getCore(), true);

        
imagewebp($this->image->getCore(), null$this->quality);

        
$this->image->mime defined('IMAGETYPE_WEBP') ? image_type_to_mime_type(IMAGETYPE_WEBP) : 'image/webp';

        
$buffer ob_get_contents();