https://github.com/dmester/jdenticon-php
PHP library for generating identicons as PNG and SVG.
https://github.com/dmester/jdenticon-php
avatar identicon jdenticon php
Last synced: 9 months ago
JSON representation
PHP library for generating identicons as PNG and SVG.
- Host: GitHub
- URL: https://github.com/dmester/jdenticon-php
- Owner: dmester
- License: mit
- Created: 2018-04-11T17:29:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-11-09T22:51:49.000Z (over 3 years ago)
- Last Synced: 2025-05-02T03:41:25.827Z (about 1 year ago)
- Topics: avatar, identicon, jdenticon, php
- Language: PHP
- Homepage: https://jdenticon.com
- Size: 122 KB
- Stars: 57
- Watchers: 2
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Jdenticon-php](https://jdenticon.com)
PHP library for generating highly recognizable identicons.

[](https://github.com/dmester/jdenticon-php/actions)
[](https://packagist.org/packages/jdenticon/jdenticon)
## Features
Jdenticon-php is a PHP port of the JavaScript library [Jdenticon](https://github.com/dmester/jdenticon).
* Renders identicons as PNG or SVG with no extension requirements
* Runs on PHP 7.4 and later (use Jdenticon package version 1.0.2 for compatibility with PHP 5.3-7.3)
## Live demo
https://jdenticon.com
## Getting started
Using Jdenticon is simple. Follow the steps below to integrate Jdenticon into your website.
### 1. Install the Jdenticon Composer package
The easiest way to get started using Jdenticon for PHP is to install the Jdenticon Composer package.
```
composer require jdenticon/jdenticon
```
### 2. Create a php file that will serve an icon
Now create a file that you call icon.php and place it in the root of your application. Add the following content to the file.
```PHP
setValue($value);
$icon->setSize($size);
$icon->displayImage('png');
```
### 3. Use icon.php
Open up your favourite browser and navigate to http://localhost:PORT/icon.php?size=100&value=anything.
An identicon should be displayed. Try to change the url parameters to see the difference in the generated icon.
## Other resources
### API documentation
For more usage examples and API documentation, please see:
https://jdenticon.com/php-api.html
## License
Jdenticon-php is released under the [MIT license](https://github.com/dmester/jdenticon-php/blob/master/LICENSE).