In general, there is a jpg image with a white background, it needs to be converted to a transparent one. The language is not particularly important, but it is better to use PCP or C for the application to be cross-platform. The question is, which libraries / languages should I use? I tried opencv, but I think you need to deal with it for a long time, but there is not much time. This option is not to offer too much noise.
<?php if(is_uploaded_file($_FILES["filename"]["tmp_name"])) { echo("success"); move_uploaded_file($_FILES["filename"]["tmp_name"], "/var/www/html/image-creator/".$_FILES["filename"]["name"]); $im = ImageCreateFromPng($_FILES["filename"]["name"]); $col = imagecolorat($im,0,0); imagecolortransparent ($im, $col); imagecopyresampled ($im, $im, 0, 0, 0, 0, imagesx($im), imagesy($im), imagesx($im), imagesy($im)); imagepng($im,"transparent-".$_FILES["filename"]["name"]); $preview = imagecreatetruecolor(88,87); imagecopyresampled ($preview, $im, 0, 0, 0, 0, 88, 87, imagesx($im), imagesy($im)); $col = imagecolorat($preview,0,0); imagecolorset($preview, $col, 255, 255, 255); imagepng($preview,"preview-".$_FILES["filename"]["name"]); imagedestroy($preview); imagedestroy($im); } else { echo("Ошибка загрузки файла"); } ?>