lib/Utility.php
public static function transparentImage(int $width, int $height): Image {
        $image = imagecreatetruecolor(max($width, 1), max($height, 1));
        $transparent = imagecolorallocatealpha($image, 0, 0, 0, 127);
        imagefill($image, 0, 0, $transparent);
        imagesavealpha($image, true);

        return new Image($image);
    }
public static function transparentImage(int $width, int $height): Image {
        $image = imagecreatetruecolor(max($width, 1), max($height, 1));
        $transparent = imagecolorallocatealpha($image, 0, 0, 0, 127);
        imagefill($image, 0, 0, $transparent);
        imagesavealpha($image, true);

        return new Image($image);
    }
public static function transparentImage ( int $ width , int $ height ) : Image { $ image = imagecreatetruecolor ( max ( $ width , 1 ) , max ( $ height , 1 ) ) ; $ transparent = imagecolorallocatealpha ( $ image , 0 , 0 , 0 , 127 ) ; imagefill ( $ image , 0 , 0 , $ transparent ) ; imagesavealpha ( $ image , true ) ; return new Image ( $ image ) ; }
Creates empty transparent GD image

@link http://php.net/manual/function.imagefill.php#110186

@param int $width
@param int $height

@return Image
Creates empty transparent GD image