Public | Automated Build

Last pushed: 3 years ago
Short Description
Short description is empty for this repo.
Full Description

Initials Avatar

Generate an avatar image from a user's initials, ideal for use as a meaningful gravatar fallback. For example:


Basic Usage

Generate a 100x100 avatar for the initials JD:

Specifying Size

Generate an 50x50 avatar for the initials JS:

Specifying Colors

Generate an avatar with custom foreground/background colors:

Use as a Gravatar Fallback

Show the Gravatar for a particular user, and fallback to showing their initials (JD) if the Gravatar doesn't exist:


This app requires ImageMagick and Ghostscript to be installed:


$ brew install imagemagick ghostscript


$ sudo apt-get install ruby-dev libmagickwand-dev imagemagick


bundle install

Starting the Server


For running locally, I recommend using the rackup command:

$ rackup


You can run this in production using Docker as follows:

$ docker pull loopj/initials-avatar
$ docker run -p 80:80 loopj/initials-avatar

Mounting Under a Rails App

If you'd like to run this from inside an existing rails app, you can mount it as follows in config/routes.rb:

match "/initials-avatar" => InitialsAvatar, :anchor => false

You can then access avatars at /initials-avatar/:initials from your rails app.

Docker Pull Command
Source Repository