glow-kit - A set for working with an image.
- Vendor: bavix
- Package: glow-kit
- Version:
- PHP Version: 7.3+
- Composer:
composer require bavix/glow-kit
The library implements simple algorithms for working with images.
- Scale Down
- Contain
- Cover
- Fit
use Intervention\Image\ImageManagerStatic;
use Bavix\Glow\Adapters\Fit;
$adapter = new Fit(ImageManagerStatic::getManager());
$image = ImageManagerStatic::make(__DIR__ . '/image.jpg');
$result = $adapter->apply($image, [
'width' => '300',
'height' => '300',
]);
$result->save(__DIR__ . '/output.jpg');
use Intervention\Image\ImageManagerStatic;
use Bavix\Glow\Adapters\Contain;
$adapter = new Contain(ImageManagerStatic::getManager());
$image = ImageManagerStatic::make(__DIR__ . '/image.jpg');
$result = $adapter->apply($image, [
'width' => '300',
'height' => '300',
]);
$result->save(__DIR__ . '/output.jpg');
use Intervention\Image\ImageManagerStatic;
use Bavix\Glow\Adapters\Cover;
$adapter = new Cover(ImageManagerStatic::getManager());
$image = ImageManagerStatic::make(__DIR__ . '/image.jpg');
$result = $adapter->apply($image, [
'width' => '300',
'height' => '300',
]);
$result->save(__DIR__ . '/output.jpg');
Supported by