JavaScript Library for Generating Random Cartoon Avatars SVG – faces.js

faces.js is a JavaScript library that generates and displays cartoon faces, somewhat reminiscent of how the Nintendo Wii generates random Miis. Faces are drawn as scalable vector graphics (SVG). Each face can also be represented by a small JavaScript object, which allows you to store that object and then draw the same face again later.As you can probably tell, the number of options for each facial feature (eyes, nose, mouth, etc.) is fairly limited, and some of the current options are fairly crude.
javascript-face.js



Download and place the JavaScript file faces.js at the bottom of the webpage.


Display a randomly-generated face (the size of #myDivId determines the size of the displayed face):

Generate and save a random face object without displaying it:





Display a saved face object:

Combining 2. and 3. into one line, generate and save a random face object while displaying it:

See live demo and download source code.

DEMO | DOWNLOAD

This awesome plugin is developed by dumbmatter. Visit their official github repository for more information and follow for future updates.