<?php

require_once __DIR__ . '/vendor/autoload.php';


// Enable error reporting
error_reporting(E_ALL);

// Display errors on the screen
ini_set('display_errors', 1);

// Rest of your PHP code




// Get the name parameter from the URL
$name = $_GET['name'];
$background = $_GET['background'];
$color = $_GET['color'];

$avatar = new LasseRafn\InitialAvatarGenerator\InitialAvatar();

$image = $avatar->name($name)->font('/fonts/NotoSans-Bold.ttf')->color($color)->background($background )->fontSize(0.5)->length(2)->size(30)->generate();

echo $image->response('png', 100);


// echo "kk";

    // $image->header('Content-Type', 'image/png');
// $image->encode('png');


// echo $image->stream('png', 100);
// return $image->encode('png');

// echo $img->response("png");


// echo $avatar->name('Lasse Rafn')->generateSvg()->toXMLString(); // returns SVG XML string



?>
