Я выполняю свой следующий код для создания прозрачного изображения, но каждый раз, когда он показывает мне черный фон.transparent image in php
любезно сообщите мне мою ошибку в коде.
<?php
//set the content type
header('Content-type: image/jpeg');
//create the image
$im = imagecreatetruecolor(250, 200);
$black = imagecolorallocate($im, 255, 255, 255);
$blue = imagecolorallocate($im, 0, 0, 255);
// Make the background transparent
imagecolortransparent($im, $black);
//text to draw
$text=$_POST['text'];
//font path
$font = '/usr/share/fonts/truetype/droid/DroidSans.ttf';
// Add the text
imagettftext($im, 15, 0, 50, 50, -$blue, $font, $text);
//view the image
imagejpeg($im);
imagedestroy($im);
?>
Вы когда-нибудь видели JPEG быть прозрачным? – frz3993