public ImageInterface::createNew($width, $height, $extension = 'png', $transparent_color = '#ffffff')
Prepares a new image, without loading it from a file.
For a working example, see \Drupal\system\Plugin\ImageToolkit\Operation\gd\CreateNew.
Parameters
int $width: The width of the new image, in pixels.
int $height: The height of the new image, in pixels.
string $extension: (optional) The extension of the image file (for instance, 'png', 'gif', etc.). Allowed values depend on the implementation