Try it!
Usage
https://avi.avris.it/{{ type }}-{{ size=128 }}/{{ base64(identifier) }}.{{ format=png }}
|
|
{{ size }} |
Size in pixels, min. 16, max. 360. |
---|---|
{{ type }} |
“letter” or “shape” |
{{ identifier }} |
Identifier, base64-encoded (with - and _ as last indexes). |
{{ format }} |
Allowed: png (default), jpg and gif . |
Examples
PHP, a 64x64 JPEG avatar:
<img src="https://avi.avris.it/letter-64/<?= strtr(base64_encode($user->getEmail()), '+/', '-_') ?>.jpg">
PHP, combine Gravatar with using Avi as a fallback:
<img src="https://www.gravatar.com/avatar/<?= md5(strtolower(trim($user->getEmail()))) ?>
?d=<?= urlencode('https://avi.avris.it/letter-64/' . strtr(base64_encode($user->getEmail()), '+/', '-_') . '.jpg') ?>
&s=64" />