PHP Library for generating SVG avatars based on React Avataaars

Related tags

Imagery avataaars
Overview

PHP library for Avataaars

PHP Library for generating SVG avatars based on React Avataaars.

Install

composer require politriukas/avataaars

Example



use Politriukas\Avataaars\Avatar;
use Politriukas\Avataaars\AvatarStyle;
use Politriukas\Avataaars\Clothing\ClothingColor;
use Politriukas\Avataaars\Clothing\GraphicShirt;
use Politriukas\Avataaars\Clothing\Graphics\Deer;
use Politriukas\Avataaars\Face\DefaultFace;
use Politriukas\Avataaars\Face\EyeBrows\RaisedExcitedNatural;
use Politriukas\Avataaars\Face\Eyes\EyeRoll;
use Politriukas\Avataaars\Face\Mouth\Grimace;
use Politriukas\Avataaars\Face\Nose\DefaultNose;
use Politriukas\Avataaars\Skin;
use Politriukas\Avataaars\Top\Accessory\Wayfarers;
use Politriukas\Avataaars\Top\FacialHair\FacialHairColor;
use Politriukas\Avataaars\Top\FacialHair\MoustacheFancy;
use Politriukas\Avataaars\Top\HairColor;
use Politriukas\Avataaars\Top\LongHairDreads;

require __DIR__.'/vendor/autoload.php';

// $avatar is instanceof SVG\SVG from `meyfa/php-svg` library
$avatar = (new Avatar())
    ->generate(
        skin: Skin::Tanned,
        face: new DefaultFace(
            eyeBrows: new RaisedExcitedNatural(),
            eyes: new EyeRoll(),
            nose: new DefaultNose(),
            mouth: new Grimace(),
        ),
        top: new LongHairDreads(
            hairColor: HairColor::SilverGray,
            facialHair: new MoustacheFancy(color: FacialHairColor::Red),
            accessory: new Wayfarers(),
        ),
        clothing: new GraphicShirt(
            color: ClothingColor::Blue03,
            graphics: new Deer(),
        ),
        style: AvatarStyle::Transparent,
    );

// Output to browser
header('Content-Type: image/svg+xml');

echo $avatar->toXMLString(false);
You might also like...
Laravel Favicon - Create dynamic favicons based on your environment settings.
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

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

PHP 5.3 Object Oriented image manipulation library

Imagine Tweet about it using the #php_imagine hashtag. Image manipulation library for PHP 5.3 inspired by Python's PIL and other image libraries. Requ

PHP Captcha library
PHP Captcha library

Captcha Installation With composer : { ... "require": { "gregwar/captcha": "1.*" } } Usage You can create a captcha with the Captc

This is a class of php QR Code, This library helps you generate QR codes in a jiffy.

This is a class of php QR Code, This library helps you generate QR codes in a jiffy.

A library using PHP to generate QRCode from https://www.qrcode-monkey.com free

PHP Class Generate Free QRCode 👉 A library using PHP to generate QRCode from https://www.qrcode-monkey.com free ✋ NOTE: Do not generate too many QRCo

PHP library to resize, scale and crop images.
PHP library to resize, scale and crop images.

PHP library to resize, scale and crop images.

PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !
PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options !

PHP Image Editor PHP library to easily edit image with GD extension. Resize, crop, merge, draw, and many more options ! ✨ Supporting ⭐ Star this repos

Goldbach Algorithms Mask is a PHP library developed for Symfony for apply a mask to strings.

Goldbach Algorithms Mask (fondly nicknamed GoldMask) is a PHP library developed for Symfony for apply a mask to strings.

Releases(v0.6)
Owner
null
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
This is my attempt at building a decent SVG sanitizer in PHP. The work is laregely borrowed from DOMPurify.

svg-sanitizer This is my attempt at building a decent SVG sanitizer in PHP. The work is laregely borrowed from DOMPurify. Installation Either require

Daryll Doyle 391 Dec 25, 2022
⚡ Dynamically generated, customizable SVG that gives the appearance of typing and deleting text. Typing SVGs can be used as a bio on your Github profile readme or repository.

⚡ Dynamically generated, customizable SVG that gives the appearance of typing and deleting text. Typing SVGs can be used as a bio on your Github profile readme or repository.

Jonah Lawrence 2k Jan 9, 2023
Upload SVG images in Magento 2.x

Upload SVG images in Magento 2.x This extension for Magento 2 allows uploading SVG images in the following sections: wysiwyg editor in static blocks a

Magegadgets 6 Dec 23, 2022
ImageWorkshop is a PHP5.3+ library that helps you to manage images based on GD library

================================ ImageWorkshop class ================================ Summary and features Really flexible and easy-to-use PHP class t

Clément Guillemain 853 Dec 27, 2022
PHP Exif Library - library for reading and writing Exif headers in JPEG and TIFF files using PHP.

PEL: PHP Exif Library README file for PEL: PHP Exif Library. A library with support for reading and writing Exif headers in JPEG and TIFF images using

null 264 Dec 4, 2022
Wonderfully easy on-demand image manipulation library with an HTTP based API.

Glide Glide is a wonderfully easy on-demand image manipulation library written in PHP. Its straightforward API is exposed via HTTP, similar to cloud i

The League of Extraordinary Packages 2.4k Dec 19, 2022
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.

Image Optimizer This library is handy and very easy to use optimizer for image files. It uses optipng, pngquant, jpegoptim, svgo and few more librarie

Piotr Śliwa 879 Dec 30, 2022
php-gd based image templates

gdaisy A highly experimental image templating system based on PHP-GD to dynamically generate image banners and covers. Installation 1. Require erikahe

Erika Heidi 67 Nov 22, 2022
Another web based photo gallery

Phyxo Simply share your images. Requirements This project use severals librairies that need at least PHP 7.3.0 This project uses a database and suppor

Nicolas 16 Oct 13, 2022