Imagestring creates blurry text?

I use imagestring to draw a small size on top of my image. I use this to draw text ( $radUrl) and save the image ( $img) until$radPath

imagestring($img, 3, 8, 8, $radUrl, imagecolorallocate($img, 255, 0, 0));
imagejpeg($img, $radPath, 100);
//($radUrl is a string, $radPath is the path to save the image)

The text that it creates is blurred. Too vague to read. The image already has an even smaller pre-existing text that is clear and easy to read.

Why is the text blurred and how can I fix this problem?

Edit: Using PNG images fixes this problem. However, in order to save bandwidth / processing power costs, I have to adhere imagejpeg. I know that JPEG compression reduces the quality of everything, in particular lines / text, but all other texts in the image are fine.

In the image below, the blurry red text at the top is the text created using imagestring, and the clear names of the white cities are already on the original image stored on my server hard drive.

enter image description here

+4
source share
1 answer

You draw red text on a green background. This is a terrible idea if you really do not want to make it illegible for about 10% of the male population . Before you continue, stop everything you do and read web accessibility .

The blurring you are currently experiencing is a direct result of JPEG compression. That's why:

, . , , . JPEG- , . , () ().

, , , , .

, . , ( , , ).

- , , -.

+1

Source: https://habr.com/ru/post/1530118/


All Articles