You can try Blockies .
Its use is quite simple (from README ):
var icon = blockies.create({ // All options are optional seed: 'randstring', // seed used to generate icon data, default: random color: '#dfe', // to manually specify the icon color, default: random bgcolor: '#aaa', // choose a different background color, default: white size: 15, // width/height of the icon in blocks, default: 10 scale: 3 // width/height of each block in pixels, default: 5 });
where icon is the canvas element.
You cannot really plan what you are going to get, however: you just get a random badge if you do not specify the seed to create it.
source share