Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


tinygraphs is an avatar generator web service. Checkout to try it.



Blog post:

Building tinygraphs an avatar web service in Go

How to use:

  • You can set the HTML source of the image to point directly to
<img src="">
  • You can save the image and use it directly on your site
  • You can go get this repo and use it.

just remember to give us credit with a link to ;)

Supported routes:

squares squares squares

squares squares squares

squares squares squares

square random banner

square random banner

square random banner

square random banner

square random banner

square random banner

isogrids random banner

isogrids random banner

isogrids random banner

square random banner

square random banner

square random banner

##Lab routes:


random random random

random random random

hexa hexa hexa

hexa16 hexa16 hexa16

gradient colors squares

gradient colors squares

gradient colors isogrids

gradient colors isogrids


  • size:

  • formats:

    The default format is SVG.

    All routes support SVG format, except Square routes who also support JPEG.

  • background and foreground:

    You can specify the color of the background or foreground by using parameters bg and fg and passing an hexadecimal value of the color:

  • theme:

    You can specify the theme you want to take into account in the image.


    Here is the list of existing themes:

    • theme base
    • theme sugarsweets
    • theme heatwave
    • themedaisygarden
    • theme seascape
    • theme summerwarmth
    • theme bythepool
    • theme duskfalling
    • theme frogideas
    • theme berrypie
  • numcolors:

    You can specify the number of colors that you want to render the image. Default value is 2 and can be extended to 4.

    theme theme theme

  • inv:

    You can specify if you want to see the colors inverted. Default value is false. inv parameter works with theme colors or default (black and white) colors. The number of colors has to be equal to 2.

    normal inverse

  • order:

    You can specify the order in which you want to see the colors by using the order parameter. Just add the indexes in which you wish to see the colors to the order array (indexes are zero based) Like so: order=3&order=2&order=1&order=0

    normal reorder

  • lines:

You can specify the number of lines that an isogrid can have using the linesparameter. Default parameter is 6. Value has to be greater or equal to 4.

number of lines in isogrid image.

  • colors: You can specify use you own colors by using the colors parameter and passing hexa colors.

![isogrid with custom colors](
  • banner parameters:

    • h: height parameter.
    • w: width parameter.
    • xt: number of triangles in isogrid banner in x axis.
    • xs: number of squares in squares banner in x axis.
    • theme: tinygraphs theme to use in banner.
    • numcolors: number of colors to take into account when rendering banner.

isogrid gradient banner.

  • random banner parameters:

    • p: probability of the main color in the banner. Default value is 0.5. Values should be between 0 and 1

    isogrid gradient banner.

  • isogrid color gradient parameters

    You can manipulate the gradient vector using the following parameter.

    • gx1: first gradient coordinate along x axis.
    • gy1: first gradient coordinate along y axis.
    • gx2: second gradient coordinate along x axis.
    • gy2: second gradient coordinate along y axis.

    isogrid color gradient


  • Go
  • Heroku

Third parties


go get
cd $GOPATH/src/
glide install
go build
export PORT=8080

Run App

> pwd
> tinygraphs
2014/11/19 22:23:57 Listening on 8080


>cd $GOPATH/src/
>go build

Test locally

option 1:

> tinygraphs
2014/12/07 00:35:02 Listening on 8080

option 2:

If you have heroku install you should be able to run

> heroku local
00:37:38 web.1  | started with pid 5762
00:37:38 web.1  | 2014/12/07 00:37:38 Listening on 8080

option 3:

> go test ./...





Note: heroku is now configured to build and deploy any git pushto master. If you still want to manual deploy the app follow the steps below.

Before you start be sure to have the proper rsa key. See Managing Your SSH Keys for more details and that. Also be sure to be logged in with heroku.

> heroku login
Enter your Heroku credentials.

After that you can deploy as follows:

> git push heroku master
Fetching repository, done.
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 287 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> Go app detected
-----> Using go1.3
-----> Running: go get -tags heroku ./...
-----> Discovering process types
       Procfile declares types -> web

-----> Compressing... done, 1.5MB
-----> Launching... done, v6 deployed to Heroku

   56a3000..5572085  master -> master


avatar generator web service




No releases published


No packages published

Contributors 4