RoboHash.Local is a local-only, .NET (WPF) adaptation of the RoboHash library by e1ven. This project allows you to generate unique avatars based on input strings without requiring any network access.
- Upstream project: RoboHash by e1ven
This package embeds the RoboHash set1 image assets directly into the assembly and deterministically composites them to produce a PNG avatar from any input string.
You can install RoboHash.Local via NuGet using either of the following methods:
From NuGet (Package Manager):
Install-Package RoboHash.Local
Or via the .NET CLI:
dotnet add package RoboHash.Local
To generate a PNG avatar as a byte[] and write it to disk, you can use the following code snippet:
using System;
using System.IO;
using RoboHash.Local;
var generator = new RoboHashSet1Generator();
byte[] png = generator.GeneratePng("alice@example.com", width: 300, height: 300);
File.WriteAllBytes("avatar.png", png);- Target framework:
net8.0-windows(uses WPF imaging types). - Assets: All assets are embedded; no network access is required.
- Deterministic output: The output is deterministic for the same input, ensuring consistent avatar generation.
RoboHash assets and the original idea come from the upstream project by e1ven. For more information, visit the RoboHash GitHub repository.