Rotating and flipping images with Imagine

Code
<?php

use Imagine\Gd\Imagine;

$imgPath 'php_logo.png';

$imagine = new Imagine();
$image $imagine->open($imgPath);

$original base64_encode($image->get('png'));

$image->flipHorizontally();
$image->rotate(45);

$rotated base64_encode($image->get('png'));

echo 
'original:<br><img src="data:image/png;base64,' $original '">' PHP_EOL;
echo 
'rotated:<br><img src="data:image/png;base64,' $rotated '">' PHP_EOL;
Result
original:

rotated:
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6