Skip to main content
net8.0net9.0net10.0

Generate deterministic avatar SVG images from names and bigrams

Published
Apr 25, 2026
5mo ago
Total Downloads
1.5K
1,496

Install

dotnet add package Meziantou.Framework.Avatar --version 1.0.1
ProductVersions
.NET
net10.0net8.0net9.0

README

Meziantou.Framework.Avatar

Generate deterministic avatar SVG strings from a name.

Usage

using Meziantou.Framework;

var svg = AvatarGenerator.CreateSvg("John Doe", new AvatarOptions());

AvatarGenerator extracts a 1-2 character bigram and selects a foreground/background pair from the palette using a hash of the provided name.

Customize the output

using Meziantou.Framework;

var options = new AvatarOptions
{
    Bigram = "JD", // optional explicit 1-2 character bigram
    Shape = AvatarShape.Round, // Round or Square
    Size = 128,
};
options.Palette.Clear();
options.Palette.Add(new AvatarColorPair("#CFDADE", "#153037"));

var svg = AvatarGenerator.CreateSvg("John Doe", options);

Changes from Previous Version

No structural changes between v1.0.0 and v1.0.1.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.