Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
avatar-generator
Advanced tools
Readme
8bit avatar generator like one below.
Inspired by https://github.com/matveyco/8biticon (icons also theirs). Generate same icons for same ids like gravatar, Use email or md5 or any string for generating and get the same avatar.
Install the module with: npm install avatar-generator
This library uses http://sharp.pixelplumbing.com/ for all image processing.
Version 2.0 is not compatible with 1.x
const AvatarGenerator = require('avatar-generator')
const avatar = new AvatarGenerator({
//All settings are optional.
parts: ['background', 'face', 'clothes', 'head', 'hair', 'eye', 'mouth'], //order in which sprites should be combined
partsLocation: path.join(__dirname, '../img'), // path to sprites
imageExtension: '.png' // sprite file extension
})
const variant = 'female' // By default 'male' and 'female' supported
const image = await avatar.generate('email@example.com', variant)
// Now `image` contains sharp image pipeline http://sharp.pixelplumbing.com/en/stable/api-output/
// you can write it to file
image
.png()
.toFile('output.png')
// or write to stream
image
.png()
.pipe(someWriteableStream)
// or reszie
image
.resize(300,300)
.png()
.toFile('output300x300.png')
// or use different format
image
.webp()
.toFile('output.webp')
Install with cli command
$ npm install -g avatar-generator
$ avatar-generator --help
$ avatar-generator --version
Copyright (c) 2019 arusanov
Licensed under the MIT license.
FAQs
8bit avatar generator. Inspired by https://github.com/matveyco/8biticon
The npm package avatar-generator receives a total of 39 weekly downloads. As such, avatar-generator popularity was classified as not popular.
We found that avatar-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.