Intervention Image (Image Processing)

The artiframe add image command installs the intervention/image package, giving your project the capability for advanced image processing. It brings modern features like resizing, cropping, adding watermarks, applying filters, and optimizing image files.

💡 Information: Direct Usage
ArtiFrame does not copy a specific integration (Wrapper/Stub) class to the src/Service folder for this package. The installation simply includes the package into the project via Composer. The codes below are basic usage examples demonstrating the package's native operations. For more information, please review the Intervention Image Documentation.
Installation
terminal
$ artiframe add image
Usage Example
ImageController.php
<?php

use Intervention\Image\ImageManagerStatic as Image;

// 1. Load an image
$img = Image::make('public/assets/images/photo.jpg');

// 2. Resize maintaining aspect ratio
$img->resize(800, null, function ($constraint) {
    $constraint->aspectRatio();
});

// 3. Add a watermark
$img->insert('public/assets/images/watermark.png', 'bottom-right', 10, 10);

// 4. Save and optimize
$img->save('public/assets/images/photo-optimized.jpg', 80);