Resize images with Imagine

Code
<?php

use Imagine\Image\Metadata\MetadataBag;
use 
Imagine\Image\Palette\RGB;
use 
Imagine\Image\Box;
use 
Imagine\Gd\Image;

$imgPath 'php_logo.png';

$resource imagecreatefrompng($imgPath);
$image = new Image($resource, new RGB(), new MetadataBag());

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

$image->resize(new Box(5050));

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

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

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