Giter Club home page Giter Club logo

dicebear's Introduction

DiceBear

With DiceBear you can create awesome avatars for your project in no time. Whether you are looking for abstract shapes or lovingly designed characters, you will find something suitable among our avatar styles. And no matter how and for what you want to use the avatars, DiceBear offers the right solution!

In addition to purely random avatars, you can also create deterministic avatars for user identities. With the built-in PRNG you create the same avatar over and over again based on a seed. But also individual avatars are possible! Just use the countless options that each avatar style provides.

And thanks to the JavaScript library, HTTP API, CLI, Figma plugin and Playground, your next avatar is always just a stone's throw away!

Playground | Documentation

dicebear's People

Contributors

davidyuk avatar dependabot[bot] avatar elierotenberg avatar flogado avatar floriankoerner avatar ozhanefemeral avatar pennstatephil avatar ralacerda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dicebear's Issues

How to use in Node?

Hello.

# npm install --save @dicebear/avatars @dicebear/avatars-male-sprites react react-dom
+ [email protected]
+ [email protected]
+ @dicebear/[email protected]
+ @dicebear/[email protected]
added 1 package from 1 contributor, updated 3 packages and audited 826 packages in 10.126s
found 0 vulnerabilities
let Avatars = require('@dicebear/avatars');
let sprites = require('@dicebear/avatars-male-sprites');

let options = {};
let avatars = new Avatars(sprites(options));
let svg = avatars.create('custom-seed');
require('fs').writeFileSync(svg, 'output.svg');

Error

let avatars = new Avatars(sprites(options));
                                         ^
TypeError: sprites is not a function

Add gender switch to avataaars

Would be nice to have a gender (male|female) option for the avataaars. I tried to fake it by setting the hair length. But then I get "females" with mustaches.

I know, nothing wrong with that... But also not suited for all my users.

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper Appā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

convert svg to base64 string

let avatars = new Avatars(sprites(options));
let svg_str = avatars.create('custom-seed').toString();

A method to convert svg to base64 is useful.

Action required: Greenkeeper could not be activated šŸšØ

šŸšØ You need to enable Continuous Integration on all branches of this repository. šŸšØ

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didnā€™t receive a CI status on the greenkeeper/initial branch, itā€™s possible that you donā€™t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how itā€™s configured. Make sure it is set to run on all new branches. If you donā€™t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, youā€™ll need to re-trigger Greenkeeperā€™s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integrationā€™s white list on Github. You'll find this list on your repo or organizationā€™s settings page, under Installed GitHub Apps.

Update: Readme

  • With fixed Version in CDN
  • With Identicon sprite set
  • With Promise example

Feature Request: a `sprites = human`

Hey, @dicebear you are awesome, very cute avatar! Kudos!

I am curious have you considered having a sprites = human option that (pseudo)randomly choose between male and female. I am building a website and needs a placeholder for people without image. I don't have gender information either so ideally if there can be a random one or even a gender-neutral option that would be awesome

Cannot find namespace 'svgson'.

Trying to use this library but have a compilation error.

node_modules/@dicebear/avatars/lib/index.d.ts:12:90 - error TS2503: Cannot find namespace 'svgson'.

Line 12: export declare type SpriteCollection<O = {}> = (random: Random, options?: O) => string | svgson.schema;

Any idea to fix this?

4.0.1 TypeError: random.pickone is not a function

TypeError: random.pickone is not a function

at Object.default_1 [as default] (/demos/node_modules/@dicebear/avatars-avataaars-sprites/lib/utils/getTopType.js:27:32)
at default_1 (/demos/node_modules/@dicebear/avatars-avataaars-sprites/lib/index.js:30:136)

My code:
var Avatars = require('@dicebear/avatars').default;
var sprites = require('@dicebear/avatars-avataaars-sprites').default;
var avatars = new Avatars(sprites({}));

Reduce API-URL length

We could completely do without the "options" object in the query parameters. We could also use aliases, such as "w" for "width" or "r" for "radius". This shortens the URL, especially for many options.

I would also completely remove the versioning of the API. The versioning (v2) leads to confusion with the library version (e.g. v5).

This is how it looks like:

Before: https://avatars.dicebear.com/v2/male/john-doe.svg?options[radius]=50&options[margin]=3&options[background]=%23ff8000&options[mood][]=happy
After: https://avatars.dicebear.com/api/male/john-doe.svg?r=50&m=3&b=%23ff8000&mood[]=happy

Improved Stats

  • New Charts Lib
  • Show charts for each sprite collection
  • Add request counter animation

yarn build leads to error "build" not found

In https://github.com/DiceBear/avatars/blob/master/server/README.md

git clone https://github.com/DiceBear/avatars.dicebear.com.git

asks for username and password.

Did you mean the following instead?

git clone https://github.com/DiceBear/avatars avatars.dicebear.com.git

Then running yarn build leads to error "build" not found:

$ cd avatars.dicebear.com.git/


$ ls
banner.svg  lerna.json  LICENSE  package.json  packages  README.md  server


$ yarn install;
yarn install v1.12.3
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 36.52s.


$ ls
banner.svg  lerna.json  LICENSE  node_modules  package.json  packages  README.md  server  yarn.lock


$ yarn build
yarn run v1.12.3
error Command "build" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Help needed - Importing all avatar images

Hello,
I am working on a social media research project and want to use for Dicebear for getting profile images 'avatars'. I need all the avatar images so that I can let user select from any one of them. Is that possible?
Thanks, and I love Dicebear!

Support Gravatar

Gravatar theoretically supports external fallback avatars, but not SVGs. There should be a way to output the avatars as PNG to use them as fallback.

api_requests index: _id_ dup key

2019-06-10T00:00:06.743256852Z app[web.1]: (node:213) UnhandledPromiseRejectionWarning: MongoError: E11000 duplicate key error collection: 5c55a5d9d5ec13ce763ee21c_avatars.api_requests index: _id_ dup key: { : "2019-06-10-identicon" }
2019-06-10T00:00:06.749986775Z app[web.1]:     at Connection.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:443:61)
2019-06-10T00:00:06.750978280Z app[web.1]:     at Connection.emit (events.js:189:13)
2019-06-10T00:00:06.750983847Z app[web.1]:     at processMessage (/app/node_modules/mongodb-core/lib/connection/connection.js:364:10)
2019-06-10T00:00:06.750988770Z app[web.1]:     at TLSSocket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:533:15)
2019-06-10T00:00:06.750993777Z app[web.1]:     at TLSSocket.emit (events.js:189:13)
2019-06-10T00:00:06.750998477Z app[web.1]:     at addChunk (_stream_readable.js:284:12)
2019-06-10T00:00:06.751003084Z app[web.1]:     at readableAddChunk (_stream_readable.js:265:11)
2019-06-10T00:00:06.751007796Z app[web.1]:     at TLSSocket.Readable.push (_stream_readable.js:220:10)
2019-06-10T00:00:06.751012388Z app[web.1]:     at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
2019-06-10T00:00:06.751017133Z app[web.1]: (node:213) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1688)

Remarks on the README

I have two remarks / suggestions on your README of avatars-jdenticon-sprites:

One that applies to all sub-repos of your project: in English, information is a mass noun, it doesn't take the plural. So the last title should read "Further information". (That's a mistake that, as a French, I made for a long time, that's why I am sensitive to it. šŸ˜„)

And I suggest to give more... information in the options table. Perhaps by the used regexes, or by the available ranges.
Even if the error messages are explicit. I got background must match the following: "/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i" (because I used # instead of %23) and padding must be less than or equal to 0.2 but it is better to indicate that explicitly in the doc.

Thanks for this very interesting library.

sprites is not a function

Hi, trying to use your great package but I'm facing a 'TypeError: sprites is not a function' when using it.

This is the way I did;
$ npm install --save @dicebear/avatars
$ npm install --save @dicebear/avatars-gridy-sprites

in js:
let avatars=require('@dicebear/avatars'),
let sprites=require('@dicebear/avatars-gridy-sprites')
let options = {};
let avatar = new avatars( sprites(options))
let svg = avatar.create('custom-seed')

And I got "TypeError: sprites is not a function"

Could you help me and point me where I'm wrong ?
Thank you !
Thierry

Rewrite avataaars

Similar to bottts, avataaars should also work without further dependencies.

Error: random.bool is not a function

/usr/local/google/home/zzn/ws/wikiloop-battlefield/node_modules/@dicebear/avatars-human-sprites/lib/index.js:9
    if (random.bool(50)) {
               ^

TypeError: random.bool is not a function
    at default_1 (/usr/local/google/home/zzn/ws/wikiloop-battlefield/node_modules/@dicebear/avatars-human-sprites/lib/index.js:9:16)
    at Object.<anonymous> (/usr/local/google/home/zzn/ws/wikiloop-battlefield/server/routes/avatar.js:17:29)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
    at Module.load (internal/modules/cjs/loader.js:914:32)
    at Function.Module._load (internal/modules/cjs/loader.js:822:14)
    at Module.require (internal/modules/cjs/loader.js:956:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/google/home/zzn/ws/wikiloop-battlefield/server/routes/index.js:24:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
    at Module.load (internal/modules/cjs/loader.js:914:32)
    at Function.Module._load (internal/modules/cjs/loader.js:822:14)
    at Module.require (internal/modules/cjs/loader.js:956:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/google/home/zzn/ws/wikiloop-battlefield/server/index.js:24:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
    at Module.load (internal/modules/cjs/loader.js:914:32)
    at Function.Module._load (internal/modules/cjs/loader.js:822:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1143:12)
    at internal/main/run_main_module.js:16:11

Debug: version

{
  'wikiloop-battlefield': '3.0.1-beta',
  npm: '6.12.1',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '35.1',
  icu: '64.2',
  llhttp: '1.1.4',
  modules: '79',
  napi: '5',
  nghttp2: '1.39.2',
  node: '13.1.0',
  openssl: '1.1.1d',
  tz: '2019a',
  unicode: '12.1',
  uv: '1.33.1',
  v8: '7.8.279.17-node.19',
  zlib: '1.2.11'
}
   "@dicebear/avatars": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/@dicebear/avatars/-/avatars-4.0.2.tgz",
      "integrity": "sha512-jVjUsZvKO5RypFE89+sFNMsu6vDQIPTNiputG1J8+EjQC0BLixfFCiI17UYLXA7xaBM2Md++y0BpnigxalbpTA==",
      "requires": {
        "pure-color": "^1.3.0",
        "seedrandom": "^2.4.3",
        "svgson": "^4.0.0"
      }
    },
    "@dicebear/avatars-female-sprites": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/@dicebear/avatars-female-sprites/-/avatars-female-sprites-4.0.2.tgz",
      "integrity": "sha512-2jWHxCj+fVnx7wWmpksKABKicyOvfcEGMExv5i9vzob7vn/EdG9xUDYrtaYQPMDxCx/5D3x+SpfokfmE90FlPw=="
    },
    "@dicebear/avatars-human-sprites": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/@dicebear/avatars-human-sprites/-/avatars-human-sprites-4.0.2.tgz",
      "integrity": "sha512-COp63a+E3D/LlJH9U5HIsfVID7QFpAo9ArWsoEWqckot38NZK53Q6cNwBhGXjIKVrVIgfXz7TZJiGKD3EUNxAQ==",
      "requires": {
        "@dicebear/avatars-female-sprites": "^4.0.2",
        "@dicebear/avatars-male-sprites": "^4.0.2"
      },
      "dependencies": {
        "@dicebear/avatars-male-sprites": {
          "version": "4.0.2",
          "resolved": "https://registry.npmjs.org/@dicebear/avatars-male-sprites/-/avatars-male-sprites-4.0.2.tgz",
          "integrity": "sha512-303iAO4pF5qheyopny0jxpo75jyPTNJ/86CwTc/zm9xy/LobirCnX4gXkP0/o7bId2XslBq1oCvcX3aTWshB1g=="
        }
      }
    },
    "@dicebear/avatars-identicon-sprites": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/@dicebear/avatars-identicon-sprites/-/avatars-identicon-sprites-4.0.2.tgz",
      "integrity": "sha512-cILbAilZ2QLSSZQ5DZqeD4N20fO53llf9w7jDj4UZoP31jBbWjAKyuoRQxNOHUWAijh0nRFq0GSBjUN7yuxvPg=="
    },
    "@dicebear/avatars-male-sprites": {
      "version": "2.1.4",
      "resolved": "https://registry.npmjs.org/@dicebear/avatars-male-sprites/-/avatars-male-sprites-2.1.4.tgz",
      "integrity": "sha512-bQKzn95FG64YD8QcjBeVIjJvsKt67mRopISm6mDWkZGsUIwrJ5Kb4rJfdXikjYDYzAb0Vj9/US5uKqOTJf5uMA=="
    },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.