PHP Identicon: Generate an identicon image for a text string

Recommend this page to a friend!
  Info   View files Example   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 99 All time: 9,472 This week: 253Up
Version License PHP version Categories
php-identicon 1.0.0MIT/X Consortium ...7HTML, PHP 5, Graphics
Description Author

This class can generate an identicon image for a text string.

It can take a given text string as parameters and generates an image that represents that text using identicon patterns.

Details like the colors, number of blocks and image size are configurable parameters.

The class generates an data URL that can be used in HTML image tags to embed the image directly in the HTML code of the pages.

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq <contact>
Classes: 46 packages by
Country: Pakistan Pakistan
Innovation award
Innovation award
Nominee: 4x

Details

PHP Identicon

Identicon is a library which generate an identicon image based on a string.

Requirement

  • PHP
  • Composer

install

run this command


## usage

<?php

use Lablnet\Identicon; require '../vendor/autoload.php'; $Identicon = new Identicon; //$Identicon->getInstance()->setBlock(2); //change block $imageDataUri = $Identicon->getImgDataBase64('php'); echo "<img src=".$imageDataUri." />";



## Change Size , color and background

<?php

use Lablnet\Identicon; require '../vendor/autoload.php'; $Identicon = new Identicon; //$Identicon->getInstance()->setBlock(2); //change block string | size | foreground | background $imageDataUri = $Identicon->getImgDataBase64('php',1000,'#fff','#dad'); echo "<img src=".$imageDataUri." />";


  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (3 files)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file readme.md Doc. Read me

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file Base.php Class Class source
  Plain text file Gd.php Class Class source
  Plain text file Identicon.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:99
This week:0
All time:9,472
This week:253Up
User Comments (3)
useful package
2 years ago (Serban Udescu)
80%StarStarStarStarStar
useful package
2 years ago (Serban Udescu)
80%StarStarStarStarStar
useful package
2 years ago (Serban Udescu)
80%StarStarStarStarStar
 

For more information send a message to info at phpclasses dot org.