Create a transparent png file using PHP

前端 未结 3 1186
我在风中等你
我在风中等你 2021-01-01 20:13

Currently I would like to create a transparent png with the lowest quality .

The code:



        
3条回答
  •  情话喂你
    2021-01-01 20:50

    To 1) imagecreatefrompng('test.png') tries to open the file test.png which then can be edited with GD functions.

    To 2) To enable saving of the alpha channel imagesavealpha($img, true); is used. The following code creates a 200x200px sized transparent image by enabling alpha saving and filling it with transparency.

提交回复
热议问题