Multiavatar is a multicultural avatar generator.

Overview

Multiavatar

Multiavatar is a multicultural avatar generator.

In total, it is possible to generate 12,230,590,464 cryptographically unique avatars.

Initially coded in JavaScript, this version of Multiavatar is re-created in PHP. It can be used in PHP-based backend environments.

For more details about the Multiavatar Generator, please refer to the readme available in the JS repository.

Installation

If you don't use composer, just include Multiavatar.php in your application.

require_once('Multiavatar.php');

Via Composer:

composer require multiavatar/multiavatar-php

Usage

$multiavatar = new Multiavatar();
$svgCode = $multiavatar("Binx Bond", null, null);

For advanced usage, pass boolean true as the second parameter if you wish to generate an avatar without the environment part.

Pass an associative array as the third parameter to generate a specific avatar version.

"11", "theme" => "C")); ">
$multiavatar = new Multiavatar();
$avatarId = "ANY_STRING";
$svgCode = $multiavatar($avatarId, true, array("part" => "11", "theme" => "C"));

API

This PHP script is powering the Multiavatar API.

To get an avatar as SVG code, add the avatar's ID to the URL:

https://api.multiavatar.com/Binx Bond

JavaScript API call example to get SVG code:

let avatarId = 'Binx Bond'
fetch('https://api.multiavatar.com/'
+JSON.stringify(avatarId))
  .then(res => res.text())
  .then(svg => console.log(svg))

To get an avatar as SVG file, add .svg to the end of the URL:

https://api.multiavatar.com/Binx Bond.svg

To get an avatar as PNG file, add .png to the end of the URL:

https://api.multiavatar.com/Binx Bond.png

Testing

To catch bugs, the representation of tests should be visual because not all bugs have programmatic errors. For example, if an equal length color array is mixed, or a double semicolon appears in a color string, in such cases an error is not thrown, but the visual representation of avatar(-s) becomes broken.

There are two types of tests, currently available in index.php and other.php files. Simply load these files in your browser from your PHP web server.

In the index.php file, visually presented are all 48 base versions or avatars. If all 48 base versions are good, then it means that all 12 billion are also good, because the 12 billion are constructed from different parts of the 48 base versions. All avatars in this file should look exactly the same as in the JavaScript repository's \svg\index.html file.

In the other.php file, additional various tests are performed to test different approaches how to generate avatars, specific avatar versions, or some repository-specific cases.

Contributors

Ignace Nyamagana Butera (@nyamsprod)

License

You can use Multiavatar for free, as long as the conditions described in the LICENSE are followed.

Screenshots

More info

For additional information and extended functionality, visit the multiavatar.com web-app.

The app is based on static html for the home page, and on Laravel 8 + Vue.js for extended functionality, including the web store.

The product mockup generator for the Merch Maker is based on the ImageMagick PHP library.

You might also like...
Avatar Generating Package for Laravel.

Avatar Generating Package for Laravel.

InfyOm Laravel Generator - API, Scaffold, Tests, CRUD Laravel Generator
InfyOm Laravel Generator - API, Scaffold, Tests, CRUD Laravel Generator

InfyOm Laravel Generator Generate Admin Panels CRUDs and APIs in Minutes with tons of other features and customizations with 3 different themes. Read

Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.
Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.

Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless develop

Laravel Design Pattern Generator (api generator)
Laravel Design Pattern Generator (api generator)

Laravel Design Pattern Generator (api generator) you can create your restful api easily by using this library and you can filter, sort and include elo

One time password generator, validator, and qrcode generator that has no web dependencies (self-contained) in PHP
One time password generator, validator, and qrcode generator that has no web dependencies (self-contained) in PHP

otp-thing One time password generator, validator, and qrcode generator that has no web dependencies (self-contained) in PHP Introduction This started

This bundle provides new generator command line tools for doctrine generator.

GenBundle This bundle provides new generator command line tools for doctrine generator, extending SensioGeneratorBundle. php bin/console gen:generate:

A PHP project/micro-package generator for PDS compliant projects or micro-packages.

Construct A PHP project/micro-package generator for PDS compliant projects or micro-packages. Installation Construct should be installed globally thro

CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages
CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages

CRUDlex CRUDlex is an easy to use, well documented and tested CRUD generator for Symfony 4 and Silex 2. It is very useful to generate admin pages for

Simple static Composer repository generator - For a full private Composer repo use Private Packagist

Satis Simple static Composer repository generator. Run from source Satis requires a recent PHP version, it does not run with unsupported PHP versions.

Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io - Deprecation Notice This repository is deprecated! Daux.io has been moved to an organization, to guarantee future development and support. So

Documentation Generator for PHP

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

An API documentation generator

Sami: an API documentation generator WARNING: Sami is not supported nor maintained anymore. Feel free to fork. Curious about what Sami generates? Have

Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)

phpDox phpDox is a documentation generator for PHP projects. This includes, but is not limited to, API documentation. The main focus is on enriching t

A php API documentation generator, fork of Sami

Doctum, a PHP API documentation generator. Fork of Sami Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documenta

GenPhrase is a secure passphrase generator for PHP applications.

About GenPhrase is a secure passphrase generator for PHP applications. GenPhrase is based on passwdqc's pwqgen program. See http://www.openwall.com/pa

A PHP report generator
A PHP report generator

PHPJasper A PHP Report Generator Docs About PHPJasper is the best solution to compile and process JasperReports (.jrxml & .jasper files) just using PH

Pdf and graphic files generator library written in php

Information Examples Sample documents are in the "examples" directory. "index.php" file is the web interface to browse examples, "cli.php" is a consol

Sculpin — Static Site Generator

Sculpin - PHP Static Site Generator Sculpin takes data sources such as text files (Markdown, Textile, etc.) and transforms them using Twig templates t

Phrozn is extremely flexible static site generator in PHP.

Phrozn Phrozn is extremely flexible static site generator in PHP. Philosophy Configurable: you should be able to tune it to your needs SCM-Enabled: no

Comments
  • Feature/improve implementation

    Feature/improve implementation

    Improve the PHP codebase to make it easier to debug.

    so instead of doing

    $avatarId = "Binx Bond";
    $multiavatar = new Multiavatar($avatarId, false, ['part' => '11', 'theme' => 'B']);
    echo($multiavatar->svgCode);
    

    Now the code behave like this

    $avatarId = "Binx Bond";
    $multiavatar = new Multiavatar();
    echo $multiavatar($avatarId, false, ['part' => '11', 'theme' => 'B']);
    

    The svgCode public property was no-where to be found. The changes makes instantiating the Multiavatar class only once to generate as many avatar as you want.

    Depending on your comment I may improve the changes.

    What I did not do, but migth be added in a Futur PR: ...

    • Move the code under a namespace;
    • Moving the $sansEnv into the $ver arguments of the Multiavatar::__invoke method
    • Adding tests;

    PS: Adding tests should be IMHO left apart as you have 2 separate implementations the best way would be to have a test suite independent of the implementation language 😉 .

    opened by nyamsprod 17
Owner
Multiavatar
12 Billion Unique Multicultural Avatars
Multiavatar
👤 Add your own default WordPress avatar.

Custom User Avatar WordPress currently only allows you to use custom avatars that are uploaded through Gravatar. Custom User Avatar enables you to use

David Artiss 13 Jan 24, 2022
The original WordPress User Avatar plugin, before it became ProfilePress

Orig User Avatar This WordPress plugin is a fork of the popular wp-user-avatar plugin, before it became ProfilePress. Compatibility with wp-user-avata

Philipp Stracker 6 Jul 17, 2021
make names from avatar name

Make Profile Image From Name Demo Of Name Like This Mana Lovez : With this package you can easily generate profile photos in different formats (for no

mohammad mohammadi 5 Nov 10, 2021
An easy-to-use PHP QrCode generator with first-party support for Laravel.

An easy-to-use PHP QrCode generator with first-party support for Laravel.

Simple Software LLC 2.2k Jan 5, 2023
QR Code Generator

QR Code By endroid If you like my work you can show appreciation by sponsoring via Github Sponsors or send me some ADA at DdzFFzCqrhszSwiFWMBQomfv6mkD

Jeroen van den Enden 3.9k Dec 30, 2022
phpThumb() - The PHP thumbnail generator

phpThumb phpThumb() - The PHP thumbnail generator phpThumb() uses the GD library and/or ImageMagick to create thumbnails from images (GIF, PNG or JPEG

James Heinrich 292 Dec 17, 2022
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
👤 Add your own default WordPress avatar.

Custom User Avatar WordPress currently only allows you to use custom avatars that are uploaded through Gravatar. Custom User Avatar enables you to use

David Artiss 13 Jan 24, 2022
The original WordPress User Avatar plugin, before it became ProfilePress

Orig User Avatar This WordPress plugin is a fork of the popular wp-user-avatar plugin, before it became ProfilePress. Compatibility with wp-user-avata

Philipp Stracker 6 Jul 17, 2021
make names from avatar name

Make Profile Image From Name Demo Of Name Like This Mana Lovez : With this package you can easily generate profile photos in different formats (for no

mohammad mohammadi 5 Nov 10, 2021