PHPackages                             ranvis/identicon - 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. ranvis/identicon

ActiveLibrary

ranvis/identicon
================

Identicon with variable complexity.

v1.0.2(4y ago)13413↓100%2[1 issues](https://github.com/ranvis/identicon/issues)BSD-2-ClausePHPPHP &gt;=7.4

Since Jun 23Pushed 2y ago2 watchersCompare

[ Source](https://github.com/ranvis/identicon)[ Packagist](https://packagist.org/packages/ranvis/identicon)[ Docs](https://github.com/ranvis/identicon/blob/master/README.md)[ RSS](/packages/ranvis-identicon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Identicon
=========

[](#identicon)

Identicon with variable complexity.

Samples
-------

[](#samples)

License
-------

[](#license)

BSD 2-Clause License

Installation
------------

[](#installation)

`composer require ranvis/identicon:1.0.*`

1.1 or later may have visual incompatibility with 1.0.

Upgrading
---------

[](#upgrading)

1.0.x is fully compatible with 1.0.0.

See [CHANGES.md](CHANGES.md) for the details.

Example Usage
-------------

[](#example-usage)

```
use Ranvis\Identicon;

require_once __DIR__ . '/vendor/autoload.php';

//$hash = md5($userId . 'YOUR_RANDOM_SALT_HERE_&ar/1R#S[|=hDF');

$hash = $_GET['hash'] ?? '';
//$hash = isset($_GET['hash']) ? $_GET['hash'] : ''; // PHP 5
if (!preg_match('/\A[0-9a-f]{32}\z/', $hash)) {
    http_response_code(404);
    exit;
}

$tile = new Identicon\Tile();
$identicon = new Identicon\Identicon(64, $tile);
header('Cache-Control: public, max-age=31556952');
$identicon->draw($hash)->output();
```

Quick Reference
---------------

[](#quick-reference)

### Identicon::\_\_construct()

[](#identicon__construct)

`__construct($maxSize, TileInterface $tile, $tiles = 6, $colors = 2, $highQuality = true)`

- int $maxSize maximum size of the icon to draw
- TileInterface $tile tile to use
- int $tiles complexity of the icon
- int $colors maximum usable colors
- bool $highQuality prefer quality over memory and speed

### Identicon-&gt;getMinimumHashLength()

[](#identicon-getminimumhashlength)

`getMinimumHashLength(): int`

get number of hex characters required to draw icon.

### Identicon-&gt;draw()

[](#identicon-draw)

`draw($hash): $this`

draw icon to internal buffer.

- string $hash arbitrary hex string

returns $this.

### Identicon-&gt;output()

[](#identicon-output)

`output($size = null, $compression = -1, $filters = -1): bool`

print PNG image to stdout with Content-Type header.

- int $size image size
- int $compression PNG compression level
- int $filters PNG filter flags to use

returns true on success.

### Identicon-&gt;save()

[](#identicon-save)

`save($filePath, $size = null, $compression = -1, $filters = -1): bool`

save PNG image to file.

- string $filePath file path to save
- int $size image size
- int $compression PNG compression level
- int $filters PNG filter flags to use

returns true on success.

### Identicon-&gt;getImage()

[](#identicon-getimage)

`getImage($size = null): resource`

get icon image.

- int $size image size

returns GD image.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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

Every ~1379 days

Total

3

Last Release

1579d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.5.0

v1.0.2PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a136f6088fc1ff14838574ad97c7ed067fc44d5f623989ba9b537f72a2ebd0fd?d=identicon)[ranvis](/maintainers/ranvis)

---

Top Contributors

[![ranvis](https://avatars.githubusercontent.com/u/139048?v=4)](https://github.com/ranvis "ranvis (9 commits)")

---

Tags

identiconidenticon

### Embed Badge

![Health badge](/badges/ranvis-identicon/health.svg)

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

###  Alternatives

[yzalis/identicon

Generate unique identicon avatars from any string

5901.1M21](/packages/yzalis-identicon)[jdenticon/jdenticon

Render PNG and SVG identicons.

60393.1k5](/packages/jdenticon-jdenticon)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)[arcanedev/gravatar

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

1986.8k](/packages/arcanedev-gravatar)[irazasyed/laravel-identicon

Laravel Identicon Package

2329.5k1](/packages/irazasyed-laravel-identicon)[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)
