Pixel-Art Avatar Generator In JavaScript – Avatars

Category: Javascript , Recommended | April 14, 2018
Author: DiceBear
Views Total: 566
Official Page: Go to website
Last Update: April 14, 2018
License: MIT

Preview:

Pixel-Art Avatar Generator In JavaScript – Avatars

Description:

Avatars is a JavaScript library to dynamically generate Github-like, SVG based pixel-art avatars for both browser and node.js environment.

How to use it:

Install the Avatars with NPM.

# NPM
$ npm install @dicebear/avatars --save

Install a sprite collection of your choice.

# male
$ npm install @dicebear/avatars-male-sprites --save

# female
$ npm install @dicebear/avatars-female-sprites --save

# identicon
$ npm install @dicebear/avatars-identicon-sprites --save

Or include the Avatars library from a CDN

<script src="https://unpkg.com/@dicebear/[email protected]/dist/avatars.min.js"></script>
<script src="https://unpkg.com/@dicebear/[email protected]/dist/sprites.min.js"></script>

Generate an avatar.

import Avatars from '@dicebear/avatars';
import SpriteCollection from '@dicebear/avatars-male-sprites';

let avatars = new Avatars(SpriteCollection);
let svg = avatars.create('custom-seed');

Leave a Reply