Create material deisgn avatars for users just like Google Messager. It may not be unique but looks better than Identicon or Gravatar.

Overview

Material-Design-Avatars Build Status

Create material deisgn avatars for users just like Google Messager.

It may not be unique but looks better than Identicon or Gravatar.

Online Demo

Language Support

ENGLISH

JTZW

FTZW

RIYU

Screenshot

Carbon Forum

Carbon Forum

Android Client for Carbon Forum

Android Client for Carbon Forum

Requirements

Initialize

<?php
require(dirname(__FILE__) . "/src/MDAvatars.php");
/*
'X'         : The character that you want to fill to the avatar.
512 (pixel) : The size of the avatar.
*/
$Avatar = new Md\MDAvatars('X', 512);
?>

Or initialize with composer:

{
	"require": {
		"lincanbin/material-design-avatars": "*.*"
	}
}
<?php
// composer 
require(__DIR__ . "/vendor/autoload.php");
use Md\MDAvatars;

$Avatar = new MDAvatars('X', 512);
?>

Usage

Show you avatar in the browser

<?php
$Avatar->Output2Browser();
?>
<?php
// You can resize the ouput size again here.
$OutputSize = 256;
$Avatar->Output2Browser($OutputSize);
// Output Base64 encoded image data.
$Avatar->Output2Base64($OutputSize);
// Get an image resource identifier.
$Avatar->Output2ImageResource($OutputSize);
?>

Save avatar to a file

<?php
$Avatar->Save('./avatars/Avatar.png');
//You can resize the size you want to save again here.
$Avatar->Save('./avatars/Avatar256.png', 256);
$Avatar->Save('./avatars/Avatar128.png', 128);
$Avatar->Save('./avatars/Avatar64.png', 64);
?>

Free memory

<?php
$Avatar->Free();
?>

Notice

If you do not need Chinese support, you can delete src/fonts/SourceHanSansCN-Normal.ttf.

When you input a Chinese character, it will automatically extract the first letter of the pinyin of the Chinese character instead of the original input if you deleted src/fonts/SourceHanSansCN-Normal.ttf.

$Avatar = new MDAvtars('林', 512);//The pinyin of "林" is "Lin".

This will be the same as that below if you deleted src/fonts/SourceHanSansCN-Normal.ttf.

$Avatar = new MDAvtars('L', 512);//The first letter of that pinyin is "Lin".

Fonts

Source Code Pro

Source Han Sans

License

Copyright 2015 Canbin Lin ([email protected])

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Create beautiful generative background images from a string. Based on jasonlong/geo_pattern

GeoPattern This is a PHP port of jasonlong/geo_pattern. Generate beautiful tiling SVG patterns from a string. The string is converted into a SHA and a

A Laravel Gravatar package for retrieving gravatar image URLs or checking the existance of an image.

Gravatar for Laravel 5.x, 6, 7 and 8 Installation First, pull in the package through Composer via the command line: composer require creativeorange/gr

Better Moderation, moderation just done better.

Better Moderation Plugin Commands /ban player reason time - Bans a player from the server. /blacklist player - Blacklists a player from the se

FBT - a internationalization framework for PHP designed to be not just powerful and flexible, but also simple and intuitive
FBT - a internationalization framework for PHP designed to be not just powerful and flexible, but also simple and intuitive

FBT is an internationalization framework for PHP designed to be not just powerful and flexible, but also simple and intuitive. It helps with the follo

I gues i tried to make a shell that's looks like a terminal in single php file
I gues i tried to make a shell that's looks like a terminal in single php file

php-shell-gui Terms of service This tool can only be used for legal purposes. You take full responsibility for any actions performed using this. The o

This component may look complex, weird and full of hacks but it is a game changer for how we run PHP applications.
This component may look complex, weird and full of hacks but it is a game changer for how we run PHP applications.

PHP Runtimes In early 2021, Symfony created a "Runtime component". This component may look complex, weird and full of hacks but it is a game changer f

WordPlate is a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.
WordPlate is a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

WordPlate is simply a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

:crystal_ball: Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.

Better Reflection Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API. Why is it b

There is no better way to learn than by watching other developers code live. Find out who is streaming next in the Laravel world.
There is no better way to learn than by watching other developers code live. Find out who is streaming next in the Laravel world.

Larastreamers This is the repository of https://larastreamers.com. It shows you who is live coding next in the Laravel world. Installation Steps clone

More Than Just a Cache: Redis Data Structures
More Than Just a Cache: Redis Data Structures

More Than Just a Cache: Redis Data Structures Redis is a popular key-value store, commonly used as a cache or message broker service. However, it can

vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with any unit test framework, like PHPUnit or SimpleTest.

vfsStream vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system. It can be used with

Looks up which function or method a line of code belongs to

sebastian/code-unit-reverse-lookup Looks up which function or method a line of code belongs to. Installation You can add this library as a local, per-

Laravel Seo package for Content writer/admin/web master who do not know programming but want to edit/update SEO tags from dashboard
Laravel Seo package for Content writer/admin/web master who do not know programming but want to edit/update SEO tags from dashboard

Laravel Seo Tools Laravel is becoming more and more popular and lots of web application are developing. In most of the web application there need some

Magento commands to find translations that are present in one CSV file but not in another, and to translate CSV dicts with DeepL
Magento commands to find translations that are present in one CSV file but not in another, and to translate CSV dicts with DeepL

Hyvä Themes - Magento translation CSV comparison command hyva-themes/magento2-i18n-csv-diff This module adds the bin/magento i18n:diff-csv and i18n:tr

      Disclaimer: The documentation of this plugin is English at the moment, but I might go for Latin later down the line, just for the fun of it.
Disclaimer: The documentation of this plugin is English at the moment, but I might go for Latin later down the line, just for the fun of it.

Quiritibus Plugin This repository is storing the custom plugin developed for the Quiritibus Latin Magazine website, currently being developed at: http

Plug n play avatar, turn name, email, and any other string into beautiful avatar (or gravatar), effortless.
Plug n play avatar, turn name, email, and any other string into beautiful avatar (or gravatar), effortless.

laravolt/avatar Display unique avatar for any user based on their (initials) name. Preview Installation This package originally built for Laravel, but

Get started with Laravel 5.3 and AngularJS (material)
Get started with Laravel 5.3 and AngularJS (material)

Laravel 5.3 Angular Material Starter Demo An online demo is available. Angular (2+) update While this starter used to be an excellent starting point f

Vote based Question & Answer site built using Laravel 5.4, material design, x-editable and jQuery Upvote with email and database notifications.
Vote based Question & Answer site built using Laravel 5.4, material design, x-editable and jQuery Upvote with email and database notifications.

About Vote based Question & Answer site built using Laravel 5.4, material design, x-editable, jQuery Upvote and email/database notifications. Register

Vote based Question & Answer site built using Laravel 5.4, material design, x-editable and jQuery Upvote with email and database notifications.
Vote based Question & Answer site built using Laravel 5.4, material design, x-editable and jQuery Upvote with email and database notifications.

About Vote based Question & Answer site built using Laravel 5.4, material design, x-editable, jQuery Upvote and email/database notifications. Register

Releases(1.4)
Owner
Canbin Lin
Golang / Python / Node.js / PHP
Canbin Lin
Plug n play avatar, turn name, email, and any other string into beautiful avatar (or gravatar), effortless.

laravolt/avatar Display unique avatar for any user based on their (initials) name. Preview Installation This package originally built for Laravel, but

Laravolt 1.7k Jan 3, 2023
🤹‍♀️Very simple to use Gravatar implementation for Laravel

Very simple to use Gravatar implementation for Laravel. Install, Include the Facade and then generate, simple! Installation You can install the packag

Wavey 11 May 7, 2022
Generate Avatars using Initials, Bears or Kittens

Avatary Simple avatar generator Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Project Built With Getting Sta

Prettify Studio 33 Nov 30, 2022
PHP Library for generating SVG avatars based on React Avataaars

PHP library for Avataaars PHP Library for generating SVG avatars based on React Avataaars.

null 5 Apr 16, 2022
image sharing site made in PHP just for fun and freetime

2bart image sharing site made in PHP just for fun and freetime To-do list: upload system [DONE] ✔️ views system [DONE] ✔️ image list system [DONE] ✔️

goom 1 Oct 22, 2021
Extract colors from an image like a human would do.

ColorExtractor Extract colors from an image like a human would do. Install Via Composer $ composer require league/color-extractor:0.3.* Usage require

The League of Extraordinary Packages 1.2k Jan 1, 2023
Laravel Optical Character Reader(OCR) package using ocr engines like Tesseract

LaraOCR Laravel Optical Character Reader(OCR) package using ocr engines like Tesseract under the hood. Features Read text from image using WebUI/Progr

Al Imran Ahmed 100 Jan 4, 2023
ColorExtractor: Extract colors from an image like a human would do

ColorExtractor Extract colors from an image like a human would do. Install Via Composer $ composer require league/color-extractor:0.3.* Usage require

The League of Extraordinary Packages 1.2k Jan 3, 2023
Create images with embedded text using advanced typography

Image with Text This class makes it super easy to render images with multiple, independently styled text blocks. You can control each text block's ali

New Media Campaigns 144 Sep 7, 2022
Laravel Favicon - Create dynamic favicons based on your environment settings.

Laravel Favicon Create dynamic favicons based on your environment settings. Laravel Package Development If you want to learn how to create reusable PH

Beyond Code 320 Dec 12, 2022