MCPcopy Index your code
hub / github.com/arusanov/avatar-generator

github.com/arusanov/avatar-generator @v2.0.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.4 ↗ · + Follow
8 symbols 19 edges 3 files 0 documented · 0% 1 cross-repo links updated 3y agov2.0.4 · 2020-05-16★ 1791 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

avatar-generator Build Status

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.

Getting Started

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

License

Copyright (c) 2019 arusanov
Licensed under the MIT license.

Core symbols most depended-on inside this repo

generate
called by 8
src/index.ts
BuildVariantsMap
called by 1
src/index.ts
getParts
called by 1
src/index.ts
checkDiscriminator
called by 0
cli.js
constructor
called by 0
src/index.ts
variants
called by 0
src/index.ts

Shape

Method 5
Class 2
Function 1

Languages

TypeScript100%

Modules by API surface

src/index.ts7 symbols
cli.js1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add avatar-generator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page