PHP Classes

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

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 62%Total: 544 All time: 5,559 This week: 206Up
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: 34
All time rank: 150319 in Iran Iran
Week rank: 200 Up2 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 (1)  
  • screenshot
  Files folder image Files (19)  
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 (19)  /  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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 94%
Total:544
This week:0
All time:5,559
This week:206Up
User Ratings User Comments (2)
 All time
Utility:89%StarStarStarStarStar
Consistency:89%StarStarStarStarStar
Documentation:-
Examples:92%StarStarStarStarStar
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:875