PHP Classes
elePHPant
Icontem

PHP Avatar Generator Class: Generate people's avatar images using their names

Recommend this page to a friend!
  Info   View files Example   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2018-11-28 (19 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 86 This week: 3All time: 9,174 This week: 112Up
Version License PHP version Categories
php-avatar 1.0.0MIT/X Consortium ...5PHP 5, Graphics
Description Author

This package can generate people's avatar images using their names.

It takes the name of a person and generates an image with a given width and given foreground and background colors that shows the first letter of the person name.

The package can return the image as a data URL that can be used in HTML img tags to display the generated avatar image.

Name: Malik umer Farooq is available for providing paid consulting. Contact Malik umer Farooq .
Classes: 37 packages by
Country: Pakistan Pakistan
Age: 17
All time rank: 135518 in Pakistan Pakistan
Week rank: 20 Up1 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 2x

Details

PHP Avatar

Allow user to generate their avatar based on name and first character will show on avatar.

enter image description hereenter image description here

Description

This package can generate people's avatar images using their names. It takes the name of a person and generates an image with a given width and given foreground and background colors that shows the first letter of the person name. The package can return the image as a data URL that can be used in HTML img tags to display the generated avatar image.

Requirement

  • PHP
  • Composer

install

run this command


## usage

<?php use Lablnet\Avatar; require '../vendor/autoload.php'; $avatar = new Avatar; $imageDataUri = $avatar->getImgDataBase64('Denil',128,'','#daf45s'); //without background color //$imageDataUri = $avatar->getImgDataBase64('Denil',128,'',''); echo "<img src=".$imageDataUri." />";




## Change Size , color and background

<?php use Lablnet\Avatar; require '../vendor/autoload.php'; $avatar= new Avatar; //string | size | foreground | background $imageDataUri = $avatar->getImgDataBase64('php',1000,'#fff','#dad'); echo "<img src=".$imageDataUri." />";

	
### Save the image
    

<?php use Lablnet\Avatar; require '../vendor/autoload.php'; $avatar= new Avatar; //string | size | foreground | background | Target+file+extension $avatar->save('Denil',118,'','','../users/profile/profile.png');

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (3 files)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file ABase.php Class Class source
  Plain text file AGd.php Class Class source
  Plain text file Avatar.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:86
This week:3
All time:9,174
This week:112Up