Помогите плиз не могу понять как убрать фон? с картинки картинка PNG нужно чтобы был персонаж чисто, сделал альфа канал на картинке а он стал белым в браузере(
Вот Код
<?php
require_once ('system/func.php');
header('content-type: image/jpeg');
$id = num($_GET['id']);
if($id)$prof = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."'"));
$pit = mysql_query("SELECT * FROM `pit_users` WHERE `id_user` = '".$prof['id']."'");
$pit = mysql_fetch_array($pit);
$fon = 0;
if($pit['level'] >= 7)$fon = 0;
if($pit['level'] >= 21)$fon = 0;
if($pit['level'] >= 40)$fon = 0;
if($pit['level'] >= 50)$fon = 0;
$image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/fon/'.$fon.'.png');
$item_7 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'nogi' AND `odeta` = 'da'");
$item_7 = mysql_fetch_array($item_7);
if($item_7){
$item_7_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_7['tip'].'/'.$item_7['item'].'.png');
imagecopy($image, $item_7_image, 0, 0, 0, 0, 480, 640);
}
$item_8 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'obuv' AND `odeta` = 'da'");
$item_8 = mysql_fetch_array($item_8);
if($item_8){
$item_8_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_8['tip'].'/'.$item_8['item'].'.png');
imagecopy($image, $item_8_image, 0, 0, 0, 0, 480, 640);
}
$item_3 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'tors' AND `odeta` = 'da' ORDER BY `id` LIMIT 1");
$item_3 = mysql_fetch_array($item_3);
if($item_3){
$item_3_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_3['tip'].'/'.$item_3['item'].'.png');
imagecopy($image, $item_3_image, 0, 0, 0, 0, 480, 640);
}
$item_1 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'golova' AND `odeta` = 'da'");
$item_1 = mysql_fetch_array($item_1);
if($item_1){
$item_1_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_1['tip'].'/'.$item_1['item'].'.png');
imagecopy($image, $item_1_image, 0, 0, 0, 0, 480, 640);
}
$item_2 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'plechi' AND `odeta` = 'da'");
$item_2 = mysql_fetch_array($item_2);
if($item_2){
$item_2_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_2['tip'].'/'.$item_2['item'].'.png');
imagecopy($image, $item_2_image, 0, 0, 0, 0, 480, 640);
}
$item_4 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'perchatki' AND `odeta` = 'da'");
$item_4 = mysql_fetch_array($item_4);
if($item_4){
$item_4_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_4['tip'].'/'.$item_4['item'].'.png');
imagecopy($image, $item_4_image, 0, 0, 0, 0, 480, 640);
}
$item_6 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'prav' AND `odeta` = 'da'");
$item_6 = mysql_fetch_array($item_6);
if($item_6){
$item_6_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_6['tip'].'/'.$item_6['item'].'.png');
imagecopy($image, $item_6_image, 0, 0, 0, 0, 480, 640);
}
$item_5 = mysql_query("SELECT * FROM `inv` WHERE `id_user` = '".$prof['id']."' AND `tip` = 'lev' AND `odeta` = 'da'");
$item_5 = mysql_fetch_array($item_5);
if($item_5){
$item_5_image = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/'.$item_5['tip'].'/'.$item_5['item'].'.png');
imagecopy($image, $item_5_image, 0, 0, 0, 0, 480, 640);
}
if($pit){
$pit = imageCreateFromPng('./images/1_mane0ken_0_is_si/'.$prof['sex'].'/pit/'.$pit['item'].'.png');
imagecopy($image, $pit, 0, 120, 0, 0, 480, 640);
}
imageJpeg($image);
?>
Вопрос задан
более трёх лет назад
65 просмотров