Golang port of DiceBear Avatars
Go to file
nfirbas 8da63012fe Exporte gender aware avatar generation (#9)
Add function to create male or female avatars

Co-authored-by: nfirbas <nejc.firbas99@gmail.com>
Reviewed-on: https://codeberg.org/Codeberg/avatars/pulls/9
Co-authored-by: nfirbas <nfirbas@noreply.codeberg.org>
Co-committed-by: nfirbas <nfirbas@noreply.codeberg.org>
2021-12-28 17:30:22 +01:00
example split library & example 2021-02-02 02:43:02 +01:00
.gitignore Update Docs 2021-02-02 02:43:59 +01:00
avatars.go Exporte gender aware avatar generation (#9) 2021-12-28 17:30:22 +01:00
go.mod
mosaic.png Dateien hochladen nach „“ 2021-02-02 02:28:24 +01:00
README.md Merge branch 'master' into split 2021-02-02 02:50:24 +01:00

Golang port of DiceBear Avatars

which in turn were inspired by 8biticon avatars

Example images

Usage

import codeberg.org/Codeberg/avatars & use string svg = avatars.MakeAvatar(seed)

Build & Use Example

# will build the binary
go build -o avatars example/main.go
# Create a random avatar and write it to /tmp/avatar.svg. Note that for the same seed string always the same image will be generated.
./avatars my-special-seed-string > /tmp/avatar.svg
# Open SVG file with image viewer
eog /tmp/avatar.svg

Create mosaic with example images using rsvg and imagemagick montage

go build -o avatars example/main.go
for i in {1..40} ; do
	./avatars my-special-seed-string_$i > /tmp/avatar_$i.svg
	rsvg-convert /tmp/avatar_$i.svg -z 10 -o /tmp/avatar_$i.png
done
montage -tile 10x4 /tmp/avatar_*.png /tmp/mosaic.png
eog /tmp/mosaic.png