Skip to content

Instantly share code, notes, and snippets.

@hyyan
Created November 5, 2017 17:00
Show Gist options
  • Save hyyan/9fe882b18686445f03ef2d003e365d3d to your computer and use it in GitHub Desktop.
Save hyyan/9fe882b18686445f03ef2d003e365d3d to your computer and use it in GitHub Desktop.
<?php
require_once 'vendor/autoload.php';
use Jaguar\Canvas,
Jaguar\Transformation,
Jaguar\Action\Color\Grayscale,
Jaguar\Action\EdgeDetection,
Jaguar\Action\Color\Negate;
$canvas = new Canvas('./image.jpg');
$canvasTransformation = new Transformation($canvas);
$canvasTransformation
->apply(new Grayscale())
->apply(new EdgeDetection(EdgeDetection::LAPLACIAN_FILTER3))
->apply(new Negate())
->getCanvas()
->show(); // send the result to the browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment