public static function createBlank($width = 1, $height = 1) { $imagick = new \Imagick(); $imagick->newImage($width, $height, new \ImagickPixel('black')); $imagick->setImageFormat('png'); // Default to PNG. return new self($imagick, '', $imagick->getImageWidth(), $imagick->getImageHeight(), $imagick->getImageFormat()); }
/** * Create a blank image. * * @param int $width Width of image in pixels. * @param int $height Height of image in pixels. * * @return ImageInterface * @throws \Exception */ public static function createBlankImage($width = 1, $height = 1) { $editorName = self::detectAvailableEditor(); if ('Imagick' === $editorName) { return ImagickImage::createBlank($width, $height); } else { return GdImage::createBlank($width, $height); } }