PHP code example of opekunov / stylish-avatar-generator
1. Go to this page and download the library: Download opekunov/stylish-avatar-generator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
opekunov / stylish-avatar-generator example snippets
//set TRUE for use Imagik
$manager = new FancyAvatarGenerator(true);
//Seed can be NULL, then it will be generated automatically
$seed = 'ohMySeed';
//Avatar style. Now support only 'flamenko'
$style = 'flamenko';
/**
* @var \Intervention\Image\Image $avatar
*/
$avatar = $manager->generateFace($seed, 'flamenko');
//Show as image
echo $avatar->response('jpg', 95);
//...or save
$avatar->save('your/path/filename', 95, 'jpg');