Calculate fuzz percent when removing background

This commit is contained in:
Samir Jafferali 2023-11-17 12:23:48 -08:00 committed by GitHub
parent bd0c4b5ca2
commit 3b12ae90a2
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);
@ -202,4 +203,4 @@
}
}
$db->close();
?>
?>