PHP Classes

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: 105 This week: 1All time: 9,693 This week: 571Up
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 is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 52 packages by
Country: Pakistan Pakistan
Age: 22
All time rank: 84611 in Pakistan Pakistan
Week rank: 103 Up4 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x

Example

<?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." />";


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:105
This week:1
All time:9,693
This week:571Up
User Comments (3)
useful package
5 years ago (Serban Udescu)
80%StarStarStarStarStar
useful package
5 years ago (Serban Udescu)
80%StarStarStarStarStar
useful package
5 years ago (Serban Udescu)
80%StarStarStarStarStar