dicebear / dicebear Goto Github PK
View Code? Open in Web Editor NEWDiceBear is an avatar library for designers and developers. š
Home Page: https://dicebear.com
DiceBear is an avatar library for designers and developers. š
Home Page: https://dicebear.com
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
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)
Would it be possible to add a gender parameter for this specific library?
Thanks,
Mark
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
Looks great ! Is it possible to get base64 output ?
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({}));
The goal is to have no dependencies.
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
We should create a sprite collection for draftbit personas.
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.
A new version of next.js has been released.
let avatars = new Avatars(sprites(options));
let svg_str = avatars.create('custom-seed').toString();
A method to convert svg to base64 is useful.
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!
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.
I am using C# to convert the SVG to PNG,
My scenario is the following
But the PNG is always broken // More details here https://stackoverflow.com/questions/58973984/svg-to-png-always-broken
šØ 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.
Just wanted to share ā another great one by āØ@pablostanley āØ
I don't know if this is equal to the Bottts set, because the illustrations have more context around.
May it's possible to just mask the canvas only to the face/profile, to have something similar like the avataaars set. š»
š #20
Just wanted to share - not sure if feasibleā¦
Create robot illustrations in Sketch App with this free library. Combine frames, antennas, sensors, accessories, and colors. š¤
/cc @pablostanley
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?
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
šØ 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.
Hi! Thank you for your avatars, they are awesome!
But why don't the human avatars support skin selection?
I think it's a very important option.
We should provide a plugin for Figma.
/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
{
'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=="
},
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.
It's vrey friendly for our users!!!
I really love it and want to introduce it to my friends!
If u can say sth about it I will be appreciate!!
Thanks. :)
It worked first, but not now
https://avatars.dicebear.com/v2/initials/A%D0%BB%D0%B5%D0%BA%D1%81%D0%B0%D0%BD%D0%B4%D1%80.svg
How to change the initials styles to rounded one any thing available?
We should provide a plugin for Sketch.
Only a small gimmick, but theoretically a seed can also be converted into a QR code.
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.
We should provide a plugin for Adobe XD.
https://adobexdplatform.com/plugin-docs/tutorials/quick-start/
InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
import Avatars from '@dicebear/avatars';
import sprites from '@dicebear/avatars-avataaars-sprites';
let options = {
base64: true,
};
let avatars = new Avatars(sprites, options);
let svg = avatars.create('beta');
Similar to bottts, avataaars should also work without further dependencies.
I donāt know if this fits perfectly but itās worth sharing:
humaaans, is a mix-&-match illustrations of people with a design library
A declarative, efficient, and flexible JavaScript library for building user interfaces.
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ššš
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ā¤ļø Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.