fix(#63): improve visibility of blurry text in 2c png

This commit is contained in:
Benjamin Nussbaum 2025-07-15 10:29:14 +02:00
parent f25d40ba46
commit 0eab9ca2b2

View file

@ -122,7 +122,12 @@ class ImageGenerationService
if ($rotate !== null && $rotate !== 0) {
$imagick->rotateImage(new ImagickPixel('black'), $rotate);
}
$imagick->setImageType(Imagick::IMGTYPE_GRAYSCALE);
// Sharpen the image to make blurry text more defined
$imagick->sharpenImage(0.7, 0.5);
if ($quantize) {
$imagick->quantizeImage(2, Imagick::COLORSPACE_GRAY, 0, true, false);
}