 buildComic = (lines, cb) ->
   buildPanels lines, (err, panels) ->
     return cb(err, null) if err
-    cb("TODO: Throw the panels on the background with padding", null)
+
+    # TODO: Note that you have mixed extension backgrounds, so you'll have
+    # to vary the loader to accommodate.
+    GD.openPng path.resolve(BG_BASE, "b29.png"), (err, bg) ->
+      return cb(err, bg) if err
+      # TODO: Composite `panels` onto `bg`
+      cb(false, bg)
 
 # Turn a set of 6 `lines` into 3 panels
 # using two lines per panel, then invokes `cb`.

# Build a single panel out of (UP TO) two lines of dialog
# cb invoked as `cb(err, image)`. `err` is only set on failure
buildPanel = (lines, cb) ->
  cb("TODO: Build a panel on a transperant background", null)

# Make any changes required to the name
filterName = (name) ->

# Scaffolds for AYP
# That good, handmade shit.

path = require 'path'
Url = require 'url'
Redis = require 'redis'
GD = require 'node-gd'

ROOT = path.resolve(__dirname, '..')
IMG_BASE = path.resolve(ROOT, 'ayp-template-images')
BG_BASE = path.resolve(IMG_BASE, 'bg')
AVATAR_BASE = path.resolve(IMG_BASE, 'avatars')

module.exports = (robot) ->
  buffer = new PantsBuffer()
