core-bundle/src/Resources/contao/library/Contao/GdImage.php
public static function fromDimensions($width, $height)
	{
		$image = imagecreatetruecolor($width, $height);

		$arrGdInfo = gd_info();
		$strGdVersion = preg_replace('/[^0-9.]+/', '', $arrGdInfo['GD Version']);

		// Handle transparency (GDlib >= 2.0 required)
		if (version_compare($strGdVersion, '2.0', '>='))
		{
			imagealphablending($image, false);
			imagefill($image, 0, 0, imagecolorallocatealpha($image, 0, 0, 0, 127));
			imagesavealpha($image, true);
		}

		return new static($image);
	}
public static function fromDimensions($width, $height)
	{
		$image = imagecreatetruecolor($width, $height);

		$arrGdInfo = gd_info();
		$strGdVersion = preg_replace('/[^0-9.]+/', '', $arrGdInfo['GD Version']);

		// Handle transparency (GDlib >= 2.0 required)
		if (version_compare($strGdVersion, '2.0', '>='))
		{
			imagealphablending($image, false);
			imagefill($image, 0, 0, imagecolorallocatealpha($image, 0, 0, 0, 127));
			imagesavealpha($image, true);
		}

		return new static($image);
	}
Get the GD image object for the specified dimensions

@param integer $width  The image width
@param integer $height The image height

@return static The GD image object