A procedural 2D avatar generation system, built as a small research project exploring two questions:
- Aesthetic harmony — does an algorithm grounded in color theory produce palettes that people rate as more pleasing than random color assignment?
- Representational diversity — can a sampling strategy be designed to actively maximize coverage across visual attributes (skin tone, hair type, body type, etc.), and how does that compare to naive uniform random sampling?
The system is one underlying engine (src/avatar_generator/) used two ways:
once as a standalone Python module, and once behind a small web demo
(web/) so the generation can be shown live.
avatar-base-project/
├── README.md
├── requirements.txt
├── src/avatar_generator/
│ ├── taxonomy.py # attribute categories + value definitions
│ ├── color_harmony.py # color-theory-based palette generation
│ ├── diversity_sampler.py # diversity-aware attribute sampling + entropy metric
│ ├── baseline.py # uniform random baseline (for comparison)
│ └── compositor.py # turns an attribute set into a renderable SVG
├── web/
│ ├── index.html
│ ├── style.css
│ └── app.js # client-side compositor for the live demo
├── assets/parts/ # SVG part library (placeholder shapes — swap with real art)
└── research/
├── NOTES.md # citations, evaluation plan, running log
└── evaluate.py # generates comparison batches + computes metrics
- Week 1 — taxonomy + compositing engine (placeholder geometric parts)
- Week 2 — color harmony module + diversity sampler
- Week 3 — evaluation: survey for color harmony, entropy metrics for diversity
- Week 4 — write-up, polish demo, record walkthrough
Most consumer avatar makers either randomize attributes uniformly (which tends to under-represent some groups and over-represent others depending on asset counts) or hand-pick a small set of "safe" combinations (which limits diversity in a different way, by curation bias). This project treats both color aesthetics and representational coverage as measurable, optimizable properties of the sampling algorithm, rather than incidental side effects of however the asset library happens to be organized.
pip install -r requirements.txt
python -m research.evaluate # generates comparison batches + metricsOr open web/index.html directly in a browser for the live demo (no server needed).