#icons #hash #random #symbols #indenticon

random-icon-lib

Generates a random icon from a template

10 releases

new 0.1.9 Apr 11, 2025
0.1.8 Mar 27, 2025

#1217 in Encoding

Download history 610/week @ 2025-03-22 146/week @ 2025-03-29 78/week @ 2025-04-05

838 downloads per month
Used in random-icon

MIT license

21KB
486 lines

A crate for creating a random round image in the svg format. Images are always symmetrical, in order to be more recognizable. It varies between transparent and black areas.

Warning

An icon can be completely empty (transparent) or only showing tiny areas. If you want something to always be visible, consider giving it a border or background.


Generates svg data by filling these areas or leaving them empty.

an image showing the outlines of the areas

Every area has a probability of about 50% of being filled.

The library performs text to image hashing and if the crate feature "rand" is enabled can also generate random symbols.

Examples

Note: Generated icons won't have a white background.

  • "Lorem ipsum dolor sit amet"

    the hashed image

  • "आइकन 🙂 ▒"

    the hashed image

  • ""

    the hashed image of an empty string

  • Example for a random one

    random

Dependencies

~1.5MB
~20K SLoC