Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1004 Bytes

basic-usage.md

File metadata and controls

37 lines (26 loc) · 1004 Bytes
title weight
Basic usage
1

Loading the image

Load an image by calling the static load method on the Image and passing in the $pathToImage.

$image = Image::load(string $pathToImage);

Applying manipulations

Any of the image manipulations can be applied to the loaded Image by calling the manipulation's method. All image manipulation methods can be chained.

Image::load('example.jpg')
    ->sepia()
    ->blur(50)
    ->save();

Sepia + blur manipulation

Saving the image

Calling the save method on an Image will save the modifications to the original file. You can save your modified image by passing a $outputPath to the save method.

Image::load('example.jpg')
    ->width(50)
    ->save('modified-example.jpg');

To save the image in a different image format or with a different jpeg quality see saving images.