Take the following base image (PNG-24):

We are trying to write text on the image as follows:
<? ini_set('display_errors', 1); error_reporting(E_ALL);
This creates low quality text (very blocky) - how would one anti-alias of the text make it look smooth?
This is the block version:

After a more thorough analysis of the png rendering (enlarged in Photoshop), I see that the text I write has no smoothing, and the pixels written are almost transparent?
What causes this - how to get smooth text?

source share