<?php
use Imagine\Image\Metadata\MetadataBag;
use Imagine\Image\Palette\RGB as C;
use Imagine\Image\Palette\Color\RGB;
use Imagine\Gd\Image;
$imgPath = 'php_logo.png';
$resource = imagecreatefrompng($imgPath);
$image = new Image($resource, new C(), new MetadataBag());
// original
$original = base64_encode($image->get('png'));
// get effects object for resource
$effects = $image->effects();
$effects->blur();
$rgbValues = [100, 255, 50];
$alpha = 0;
$rgb = new RGB(new C(), $rgbValues, $alpha);
$effects->colorize($rgb);
$effects->gamma(4);
// changed image
$changed = base64_encode($image->get('png'));
echo 'original:<br><img src="data:image/png;base64,' . $original . '">' . PHP_EOL;
echo 'effects:<br><img src="data:image/png;base64,' . $changed . '">' . PHP_EOL;