PHPackages                             malenki/aleavatar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. malenki/aleavatar

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

malenki/aleavatar
=================

1.0.0(8y ago)6651[3 issues](https://github.com/malenkiki/aleavatar/issues)MITPHPPHP &gt;=5.3.0

Since Jun 4Pushed 8y ago2 watchersCompare

[ Source](https://github.com/malenkiki/aleavatar)[ Packagist](https://packagist.org/packages/malenki/aleavatar)[ RSS](/packages/malenki-aleavatar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

aleavatar
=========

[](#aleavatar)

Generator of random avatars aka identicons, like you can see on Stackoverflow for example!

How it works?
-------------

[](#how-it-works)

This PHP library create a `md5` sum from the string you give.

Each two character is taken, so, we get a string of 32 ÷ 2 = 16 characters.

For this 16 hexadecimal characters, we take the first 8 of them to choose basic shapes to use in the picture, the 6 followings are used to create the foreground color, the last but one is used to place basic shapes and the last is used to choose the rotation way of each quarter part.

What do I get?
--------------

[](#what-do-i-get)

You get by default a picture of 128px × 128px. This picture can be SVG or PNG. For PNG, you must have one of this PHP modules: [ImageMagick](http://www.php.net/manual/en/book.imagick.php) or [GD](http://www.php.net/manual/en/book.image.php).

I recommand you the first one. GD is a fallback very poor (no scaling and antialias if you have PHP version prior to 5.5).

You can display PNG images or store them. As you want.

SVG can be used into HTML5 document or as standalone SVG file.

How to install it?
------------------

[](#how-to-install-it)

Using composer it is very simple.

Just put this into your `composer.json` file:

```
require: "malenki/aleavatar": "dev-master"
```

Do you have some examples?
--------------------------

[](#do-you-have-some-examples)

Yes. The first, very simple, generates a (pseudo)random SVG avatar and save it into `my_avatar.svg` file:

```
$a = new Malenki\Aleavatar\Aleavatar();
$a->generate()->svg('my_avatar.svg');
```

Now, this one generates one SVG avatar to display into HTML5 based on the string "My avatar is fun!":

```
$a = new Malenki\Aleavatar\Aleavatar("My avatar is fun!");
$strSVG = $a->generate()->svgForHtml5();
```

The same but to generate PNG to display on browser :

```
$a = new Malenki\Aleavatar\Aleavatar("My avatar is fun!");
header('Content-Type: image/png');
echo $a->generate()->png();
exit();
```

You can change size in pixel too:

```
$a = new Malenki\Aleavatar\Aleavatar();
$a->generate(200)->svg('my_avatar.svg');
```

**Note:** If you have GD as fallback, and your PHP version is inferior to 5.5, then you have not scaling.

Enjoy!

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3260d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6af62130bd16d4e6bbaa5877829b6377386ef9fb6593592052dbb6eeb87c4a02?d=identicon)[malenki](/maintainers/malenki)

---

Top Contributors

[![malenkiki](https://avatars.githubusercontent.com/u/195776?v=4)](https://github.com/malenkiki "malenkiki (94 commits)")

---

Tags

generatorsvgpngavataridenticonpicture

### Embed Badge

![Health badge](/badges/malenki-aleavatar/health.svg)

```
[![Health](https://phpackages.com/badges/malenki-aleavatar/health.svg)](https://phpackages.com/packages/malenki-aleavatar)
```

###  Alternatives

[yzalis/identicon

Generate unique identicon avatars from any string

5901.1M21](/packages/yzalis-identicon)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)[multiavatar/multiavatar-php

Multicultural Avatar Generator

653150.0k4](/packages/multiavatar-multiavatar-php)[jkphl/iconizr

A PHP command line tool for converting SVG images to a set of CSS icons (SVG &amp; PNG, single icons and / or CSS sprites) with support for image optimization and Sass output

4868.9k](/packages/jkphl-iconizr)[arcanedev/gravatar

A library providing easy gravatar integration/generation (Laravel supported).

1986.8k](/packages/arcanedev-gravatar)[splitbrain/php-ringicon

A indenticon/glyphicon like avatar generator

1613.3k1](/packages/splitbrain-php-ringicon)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
