Fork me on GitHub

make — Create a new image resource


public static Intervention\Image\Image make(mixed $source)

Static universal factory method to create a new image instance from source, which can be a filepath, a GD image resource or a binary image data.



Source to create an image from. The method responds to the following input types:

Return Values

Instance of Intervention\Image\Image


// create a new image resource from file
$img = Image::make('public/foo.jpg');

// create a new image from gd resource
$resource = imagecreatefromjpeg('public/foo.jpg');
$img = Image::make($resource);

// create a new image resource from binary data
$data = file_get_contents('public/foo.jpg');
$img = Image::make($data);

// create a new image directly from an url
$img = Image::make('');

See also