https://github.com/discourse/letter-avatars
Teeny tiny web service to generate letter-based avatars
https://github.com/discourse/letter-avatars
Last synced: 3 months ago
JSON representation
Teeny tiny web service to generate letter-based avatars
- Host: GitHub
- URL: https://github.com/discourse/letter-avatars
- Owner: discourse
- Created: 2015-09-10T11:35:05.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-05-27T14:41:11.000Z (about 1 year ago)
- Last Synced: 2024-05-27T16:07:00.606Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 16.7 MB
- Stars: 39
- Watchers: 21
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is the "Letter Avatar" microservice, a means of generating a simple
coloured letter image, for use as a generic avatar. It was first
implemented for use as part of the [Discourse](http://discourse.org)
platform, however it can be used for any service which requires a simple,
distinctive avatar for users who haven't set one themselves.# API
The only resource which this service will respond to is the path:
/letter/[a-z]
The variable part indicates which letter to render. It can be specified as
uppercase or lowercase, and will be rendered in uppercase in all
circumstances.From version 4 onwards, the requested letter can be any unicode character,
URL encoded or not. If the character can't be draw using any of the fonts
availiable in the fonts directory, the response will be 404.The URL can take the following query parameters. All are optional, and
have halfway-reasonable defaults.* `r` (default: 0) the "red" component of the background colour to use in
the image.* `g` (default: 0) the "green" component of the background colour to use in
the image.* `b` (default: 0) the "blue" component of the background colour to use in
the image.* `size` (default: 50) the number of pixels wide and high to make the image.
All avatar images are squares.* `v` (default: 1) which version of the API to use. Version 4 has unicode support.
# Deployment
Dockerfile ftw!