Press "Enter" to skip to content

[Cartoon Avatars] A JavaScript Library For Creating Vector-Based Animated Faces

faces.js is a standalone JavaScript library that is used to create random SVG-based cartoon faces for user avatars. Generate random cartoon avatars with js and SVG faces js code.

image to cartoon javascript, javascript avatar generator, faces js, avatar html css, avataaars js, bootstrap avatar image, avatar image css

Wrote this to generate random cartoon faces for players in Basketball GM and Football GM. You can use it for similar purposes, or other purposes.

How to make use of it:

1. Install and import.

# Yarn
$ yarn add facesjs

# NPM
$ npm i facesjs
import * as faces from "facesjs";

2. OR Download and place the JavaScript file faces.js on the backside of the webpage.

<script src="faces.js"></script>

3. Generate a random cartoon avatar inside a given container.

<div id="example"></div>
const face = generate();
display("example", face);

4. Get the cartoon avatar as a JS object.

var face = faces.generate("example");
console.log(face);

5. Customize the color of the avatar.

const face = generate({
      body: { color: "yellow" }
});
// or
faces.display("example", face, { 
  body: { color: "yellow" } 
});

6. Specify the race: white, black, asian, or brown.

const face = generate({
      null, 
      {race: "white"}
});

Generate Random Cartoon Avatars, faces.js Plugin/Github


See Demo And Download

Official Website(dumbmatter): Click Here

This superior jQuery/javascript plugin is developed by dumbmatter. For extra advanced usage, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.