use img\Image;
use img\io\JpegStreamReader;
use io\File;
$image= Image::loadFrom(new JpegStreamReader(new File('image.jpeg')));
// Can now be manipulated
Resizing the original image to 640x480
use img\Image;
$transformed= Image::create(640, 480, Image::TRUECOLOR);
$transformed->resampleFrom($image);
Apply filters:
use img\filters\SharpenFilter;
$transformed->apply(new SharpenFilter());
Convert:
use img\convert\GrayscaleConverter;
$transformed->convertTo(new GrayscaleConverter());
use img\io\JpegStreamWriter;
use io\File;
$transformed->saveTo(new JpegStreamWriter(new File('transformed.jpeg'), 100));