Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the user id image generated on SO?

I am a little curious about the cute little kaleidoscopic images associated with each user on this site. How are those generated? Possibilities are:

  1. A list of images is already there in some folder and it is chosen randomly.
  2. The image is generated whenever a user registers.

In any case, I am more interested in what kind of algorithm is used to generate such images.

like image 491
nullDev Avatar asked Sep 19 '08 13:09

nullDev


4 Answers

It's called an Identicon. If you entered and e-mail, it's a based on a hash of your e-mail address. If you didn't enter an e-mail, it's based on your IP address.

Jeff posted some .NET code to generate IP based Identicons.

like image 56
Chris Upchurch Avatar answered Oct 03 '22 18:10

Chris Upchurch


Its usually generated from a hash of either a user name, email address or ip address.

Stackoverflow uses Gravatar to do the image generation.

As far as I know the idea came from Don Parks, who writes about the technique he uses.

like image 30
Matt Howells Avatar answered Oct 03 '22 17:10

Matt Howells


IIRC, it's generated from an IP address.

"IP Hashing" I believe it's called.

I remember reading about it on a blog; he made the code available for download. I have no idea where it was from, however. :(

like image 34
TraumaPony Avatar answered Oct 03 '22 17:10

TraumaPony


The images are produced by Gravatar and details of them are outlined here, however, they do not reveal how they are doing it.

like image 28
GateKiller Avatar answered Oct 03 '22 17:10

GateKiller