The code is in a very early and experimental stage of development. Many features are not yet implemented and tested. There may still be significant changes. Therefore, it is not recommended to use the driver in production environments.
Driver to use libvips with Intervention Image. Combines the easy-to-use API of Intervention Image with the technical performance of libvips.
- PHP >= 8.1
- Intervention Image >= 3
You can easily install this library using Composer. Just request the package with the following command:
composer require intervention/image-driver-vips
The public API of Intervention Image can be
used unchanged. The only configuration that needs to be done is to ensure that
the libvips
driver is used by Intervention\Image\ImageManager
.
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Vips\Driver as VipsDriver;
// create image manager with vips driver
$manager = ImageManager::withDriver(VipsDriver::class);
// open an image file
$image = $manager->read('images/example.gif');
// resize image instance
$image->resize(height: 300);
// insert a watermark
$image->place('images/watermark.png');
// encode edited image
$encoded = $image->toJpg();
// save encoded image
$encoded->save('images/example.jpg');
Check out the documentation
composer test