2021-02-02 03:41:25 +03:00
|
|
|
# Golang port of DiceBear Avatars, which in turn were inspired by 8biticon avatars
|
|
|
|
|
2021-02-02 04:29:42 +03:00
|
|
|
![Example images](mosaic.png)
|
|
|
|
|
2021-02-02 03:41:25 +03:00
|
|
|
## Build & Run
|
|
|
|
|
|
|
|
```shell
|
2021-02-02 04:43:25 +03:00
|
|
|
# will build the binary into ${BUILDDIR}. The golang compiler is fetched and installed into ${BUILDDIR}
|
2021-02-02 03:41:25 +03:00
|
|
|
make BUILDDIR=$PWD
|
|
|
|
# Create a random avatar and write it to /tmp/avatar.svg
|
|
|
|
$PWD/gitea/bin/avatar my-special-seed-string > /tmp/avatar.svg
|
2021-02-02 04:43:25 +03:00
|
|
|
# Open SVG file with image viewer
|
2021-02-02 04:29:42 +03:00
|
|
|
eog /tmp/avatar.svg
|
2021-02-02 03:41:25 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2021-02-02 04:29:42 +03:00
|
|
|
## Create mosaic with example images using rsvg and imagemagick montage
|
|
|
|
|
|
|
|
```shell
|
|
|
|
make BUILDDIR=$PWD
|
|
|
|
for i in {1..40} ; do
|
|
|
|
$PWD/gitea/bin/avatar 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
|
|
|
|
```
|
|
|
|
|