Merge pull request #58 from sjafferali/main

Calculate fuzz percent when removing background
This commit is contained in:
Miguel Ribeiro 2023-11-17 22:29:28 +01:00 committed by GitHub
commit f9324bf011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,8 @@
$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);