Skip to content

Repository files navigation

Utopia Image

Important

This repository is a read-only mirror of the utopia-php monorepo. Development happens in packages/image — please open issues and pull requests there.

Total DownloadsDiscord

Utopia Image is a lightweight PHP library for common image manipulations. It is maintained by the Appwrite team.

Getting started

Install using Composer:

composer require utopia-php/image
<?phprequire_once'../vendor/autoload.php';
useUtopia\Image\Image;
//crop image$image = newImage(\file_get_contents('image.jpg'));
$target = 'image_100x100.jpg';
$image->crop(100, 100, Image::GRAVITY_TOP_LEFT);
$image->save($target, 'jpg', 100);
$image = newImage(\file_get_contents('image.jpg'));
$target = 'image_border.jpg';
$image->setBorder(2, "#ff0000"); //add border 2 px, red$image->setRotation(45); //rotate 45 degree$image->save($target, 'jpg', 100);
$image = newImage(\file_get_contents('image.jpg'));
$target = 'image_border.jpg';
$image->setOpacity(0.2); //set opacity$image->save($target, 'png', 100);

System requirements

Utopia Image requires PHP 8.1 or later. We recommend using the latest PHP version whenever possible.

Copyright and license

The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php

About

Lite & fast micro PHP library for creating common image manipulations that is **easy to use**.

Topics

Resources

Code of conduct

Stars

13 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages