PHP Classes

PHP Avatar Generator: Creator for avatar images from parts of user faces

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (18)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 67%Total: 544 This week: 1All time: 5,552 This week: 560Up
Version License PHP version Categories
avatar-generator 1.1GNU General Publi...5.0HTML, PHP 5, Graphics
Description 

Author

This class is a creator for avatar images from parts of user faces.

It takes parameters that define characteristics of the avatar user faces like the hair, lips, nose, and eyes.

The class generates HTML that makes the avatar faces appear overlapping images that display the chosen parts of the avatar faces.

Innovation Award
PHP Programming Innovation award winner
November 2014
Winner


Prize: One downloadable e-book of choice by O'Reilly
Avatars are images often used by users to represent themselves graphically in an application.

Some applications use real pictures of the users but others let the users choose other graphics to be used as the user avatars.

This class allows users to customize their avatar by composing a picture of their faces from a set of pre-defined images that represent the user eyes, nose, hair and lips.

Manuel Lemos
Picture of pooya sabramooz
  Performance   Level  
Name: pooya sabramooz is available for providing paid consulting. Contact pooya sabramooz .
Classes: 4 packages by
Country: Iran Iran
Age: 33
All time rank: 150519 in Iran Iran
Week rank: 411 Up4 in Iran Iran Up
Innovation award
Innovation award
Nominee: 2x

Winner: 2x

Example

<?php include './class.avatar.php'; ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Avatar Builder</title>
</head>

<body>

<?php
$anna
= new Avatar('f');
$anna->setHair();
$anna->setNose();
$anna->setLips();
$anna->setEyes();
echo
$anna->draw();

$sara = new Avatar('f');
$sara->setHair('1','black');
$sara->setNose('2');
$sara->setLips('1','red');
$sara->setEyes();
echo
$sara->draw();

$elizabeth = new Avatar('f');
$elizabeth->setHair('1','brown');
$elizabeth->setNose('1');
$elizabeth->setLips('1','red');
$elizabeth->setEyes();
echo
$elizabeth->draw();

$john = new Avatar('m');
$john->setHair();
$john->setNose();
$john->setLips();
$john->setEyes();
echo
$john->draw();

$jack = new Avatar('m');
$jack->setHair('1','brown');
$jack->setNose('1');
$jack->setLips('1');
$jack->setEyes();
echo
$jack->draw();
?>

</body>
</html>


Screenshots  
  • screenshot
  Files folder image Files  
File Role Description
Files folder imageimages (16 files)
Plain text file class.Avatar.php Class base class
Accessible without login Plain text file index.php Example example of usage

  Files folder image Files  /  images  
File Role Description
  Accessible without login Image file f-base.png Icon Components
  Accessible without login Image file f-eyes-1-defualt.png Icon Components
  Accessible without login Image file f-hair-1-black.png Icon Components
  Accessible without login Image file f-hair-1-brown.png Icon Components
  Accessible without login Image file f-hair-1-defualt.png Icon Components
  Accessible without login Image file f-lips-1-defualt.png Icon Components
  Accessible without login Image file f-lips-1-red.png Icon Components
  Accessible without login Image file f-nose-1-defualt.png Icon Components
  Accessible without login Image file f-nose-2-defualt.png Icon Components
  Accessible without login Image file m-base.png Icon Components
  Accessible without login Image file m-eyes-1-defualt.png Icon Components
  Accessible without login Image file m-hair-1-black.png Icon Components
  Accessible without login Image file m-hair-1-brown.png Icon Components
  Accessible without login Image file m-hair-1-defualt.png Icon Components
  Accessible without login Image file m-lips-1-defualt.png Icon Components
  Accessible without login Image file m-nose-1-defualt.png Icon Components

 Version Control Unique User Downloads Download Rankings  
 94%
Total:544
This week:1
All time:5,552
This week:560Up
User Ratings User Comments (2)
 All time
Utility:95%StarStarStarStarStar
Consistency:95%StarStarStarStarStar
Documentation:-
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:67%StarStarStarStar
Rank:450