Currently I would like to create a transparent png with the lowest quality .
The code:
1) You can create a new png file without any existing one.
2) You get a black color image because you use imagecreatetruecolor();
. It creates a highest quality image with a black background. As you need a lowest quality image use imagecreate();
You can read more in this article: How to Create an Image Using PHP