PHP code example of polar-nik / artifex
1. Go to this page and download the library: Download polar-nik/artifex library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
polar-nik / artifex example snippets
$image = new \PolarNik\Artifex\Artifex('path/to/image.jpg');
$image->cut(512, 512); // Обрезать изображение
$image->watermark('path/to/watermark.png'); // Добавить водяной знак
$image->save('path/to/image-image-with-watermark.jpg'); // Сохранить изображение
$image = new \PolarNik\Artifex\Artifex('path/to/another-image.jpg');
$image->thumb(256, 256); // Создать превью
$image->output('path/to/image-image-with-watermark.jpg'); // Вывести изображение