I made an old school Internet counter for my Twitter background. Someone could view my profile and clicking the link to increment the counter and image.
Node Canvas
To generate the new image we use Node Canvas.
Canvas = require "canvas"
Image = Canvas.Image
message = require "./message"
module.exports = (number, cb) ->
canvas = new Canvas(200, 200)
ctx = canvas.getContext("2d")
ctx.fillStyle = "#ffffff"
ctx.font = "30px Helvetica"
ctx.fillText(message(number), 10, 120)
cb canvas.toDataURL()
Dockerfile
Managing the dependencies would be a pain however, with Docker it is straightforward.
RUN apt-get update && apt-get install -y \
libcairo2-dev \
libjpeg62-turbo-dev \
libpango1.0-dev \
libgif-dev \
build-essential \
g++