Pixel-Art Avatar Generator by Identifier in JavaScript for Browsers and NodeJS.
Test in your Browser: https://avatars.dicebear.com/
GET https://avatars.dicebear.com/v1/:spriteSet/:seed/:size.png
:spriteSet => male|female
:seed => string|number
:size => 20 - 200 (px)
Check out our OpenSource API-Server
bower install dicebear-avatars
npm install @dicebear/avatars
<script type="text/javascript" src="https://rawgit.com/DiceBear/avatars/master/dist/avatars.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/DiceBear/avatars/master/dist/avatars.pack.min.js"></script>
DiceBear Avatars requires async, chance and one-color. Load this libraries from a CDN, from bower or use the avatars.pack.min.js bundled within this Repository.
var avatars = var Avatars(Avatars.SPRITE_SETS.male);
var seed = 'custom-seed';
avatars.create(seed, { size: 200 }, function(err, canvas) {
// canvas.toDataURL()
});
var avatars = var Avatars(Avatars.SPRITE_SETS.female);
var seed = 'custom-seed';
avatars.create(seed, { size: 200 }, function(err, canvas) {
// canvas.toDataURL()
});
- size: number
- order: sprite order as array
See examples: https://github.com/DiceBear/avatars/tree/master/assets/male
Sprite parts must be arranged horizontally. The library will detect the dimensions automatically.
See examples: https://github.com/DiceBear/avatars/tree/master/src/spriteSets
Inspired by 8biticon