By default, calling the save
method on the Image
will apply all manipulations to your original image file.
Image::load('example.jpg')
->sepia()
->save();
To save the image as a copy in a new location pass in the optional $outputPath
.
Image::load('example.jpg')
->sepia()
->save('sepia-example.jpg');
##Saving in a different image format
To save your image as a different image format you can simply change the extension in your output path.
Image::load('example.jpg')
->save('example.png');
You can find the supported image formats here: Supported image formats
##Changing JPEG quality
By calling the quality
method on the Image
you can specify the JPEG quality in percent. This only applies to saving JPEG files.
The $quality
argument should be an integer ranging from 0
to 100
.
Image::load('example.jpg')
->quality(20)
->save();