$width = 500; $height = 300; $image = imagecreate($width, $height);
$image_path = "image.jpg"; $image = imagecreatefromjpeg($image_path);This example shows how to create an image resource from an existing JPEG file. The PHP image create function is part of the GD graphics library, which is a popular package for creating and manipulating images in PHP.