mathidenticon

NineBlock generation


Im looking to make my own implementation of these Identicons or Gravatars found here on StackOverflow. Most questions I could found was about utilizing existing 3rd party libraries, especially those hooked with Gravatar.

alt text
(source: levitated.net)

After some searching I stumbled upon this page. And from the looks of it, its not that hard. What needs to be randomly picked is:

Seed a randomizer with the md5 hash value and start retrieving random numbers. Then, add (pi/2)*i to each shape around the edge to create that cool radial symmetry effect.

You could say Im thinking in text here, but I want to know if Ive misunderstood anything. Also, if you have any thought one what more could be randomized to increase the diversity. Will the look or feel be "broken" if I start changing the:


Solution

  • As you can see in your own gravatar on this site, you can go for a 4x4 field. An even number of cells per side will limit less on the shapes used in the middle, as they are rotated as well.

    Offsets could be allowed, if rotated. Offsets that are equal on both dimensions might look more symetrical and could be favoured, but it is not necessary to do so.

    You can also rotate differently, by 180°, loosing some symmetry, but as you can see here, it does give you interesting identicons.

    Of course you could pick more then two colors. From an estetical standpoint, choose wisely from colors within a certain scheme. Maybe some effects like making the colors lighter or darker towards the edges gradually would look very interesting.

    Do I understand you correctly that you would seed the randomizer with the MD5 value of the users email address and thus be able to recalculate his gravatar on the fly? No need then to have him create an account.