Skip to content

Commit

Permalink
Merge pull request ellite#58 from sjafferali/main
Browse files Browse the repository at this point in the history
Calculate fuzz percent when removing background
  • Loading branch information
ellite committed Nov 17, 2023
2 parents bd0c4b5 + 3b12ae9 commit f9324bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions endpoints/subscription/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function saveLogo($imageData, $uploadFile, $name) {

$imagick = new Imagick($tempFile);
if ($removeBackground) {
$imagick->transparentPaintImage("rgb(247, 247, 247)", 0, 102, false);
$fuzz = Imagick::getQuantum() * 0.1; // 10%
$imagick->transparentPaintImage("rgb(247, 247, 247)", 0, $fuzz, false);
}
$imagick->setImageFormat('png');
$imagick->writeImage($uploadFile);
Expand Down Expand Up @@ -202,4 +203,4 @@ function resizeAndUploadLogo($uploadedFile, $uploadDir, $name) {
}
}
$db->close();
?>
?>

0 comments on commit f9324bf

Please sign in to comment.