WebP Support in imagecreatefromstring()

WebP is an image format that supports lossless as well as lossy compression. As of PHP 7.3, the imagecreatefromstring() function also supports the WebP format. This allows creating a new image resource that can be used with the other functions provided by the GD extension from a string that contains a WebP image stream:

// Load WebP image stream from file
$imageStream = file_get_contents(__DIR__ . '/image.webp');

// Create GD image resource from image stream
$image = imagecreatefromstring($imageStream);

// Do something with the image resource

// Clean up image resource