To create a png with the transparent background:
newimage(width, height, "transparent", "png")
PHP - Manual: Gmagick::newimage
2024-11-12
(PECL gmagick >= Unknown)
Gmagick::newimage — Creates a new image
Creates a new image with the specified background color.
width
Width of the new image.
height
Height of the new image.
background
The background color used for this image (as float).
format
Image format.
The Gmagick object.
错误时抛出 GmagickException。