Git Product home page Git Product logo

spittoon's Introduction

Spittoon

Spittoon is a comic strip generator. It is an implementation of the Microsoft Comic Chat algorithm described in the paper, Comic Chat (Reprinted from SIGGRAPH '96 Proceedings).

I wrote this as an experiment to learn Ruby in 2005. I had planned on making an ongoing comic strip, but it turned out that I wasn't very funny. I've now released it as open-source.

License

The source code is licensed under the MIT License.

The images in the artwork/ and backgrounds/ directories are licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Getting Started

First, install RMagick.

Next, cd to examples/ and run:

ruby -I ../lib ../bin/make_comic.rb -c config.yaml -s spec -o example.png

Voila -- a comic has been generated.

...or not. Spittoon may crash on you. If it does, just re-run the generator. Spittoon picks variations at random and sometimes they simply don't work. When something doesn't fit, Spittoon bails. (Yes, I know this isn't great, but I had always planned on running this from a terminal where I could re-run the command easily.)

Chat Spec Scripts

I called them "specs" because originally they were YAML files of "chat specifications." This became a pain in the ass so I created a simpler but more magical text format.

For example:

a->b: hey! (happy/exclaiming)
b: hi! (positive)
c

This is a one-panel comic with three characters. The characters will be chosen at random (see characters in config.yaml) and assigned to a, b, and c. For specific characters you can use their names directly, e.g. alice->bob.

a->b means that a will be looking at b. The direction of the other characters will be determined by who is speaking. It is possible to cram four or more characters in a panel and have multiple groups chatting with one another.

Order matters. The characters will be placed in the order defined in the spec. This makes things a little hairy when you want to have one character monologuing, but Spittoon tries to figure it out.

(happy/exlaiming) picks the happy face and exclaiming pose from the artwork directory. You can specify exact faces and poses or you can specify a set which is named in config.yaml, such as positive or negative. You can specify just a face with (facename) and just the pose with (/posename).

To create a new panel, simply re-use a character name. Since the same character can't appear twice in the same panel, this is the signal that a new panel is necessary.

Narration is possible, meaning you can include a rectangular chat balloon which isn't pointing toward anyone. Unfortunately, it still needs to be attached to a character:

robin* back at the bat cave...
batman: are those steaks ready yet?

See the spec in examples/spec for another example.

Customization

The basic idea of Spittoon was to write a minimal chat script (ideally being able to paste from IRC with few modifications) and have a comic be generated with random variations. It's supposed to be mostly hands-off.

There are a lot of options in examples/config.yaml. They're mostly self-obvious.

Panel layouts, however, are hard-coded. How many panels you get in the strip is determined by the chat script -- more panels are added when a text balloon can't fit in a single strip. A 3-panel strip is always rendered vertically.

Want better fonts? A great source for free and commercial comic fonts is Blambot Comic Fonts. A lot of comic fonts are dual-weight -- lowercase text produces normal-weight letters and uppercase text produces bold letters.

Development

I am not actively using or maintaining Spittoon, but I welcome your patches. Fork at your leisure.

spittoon's People

Contributors

statico avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.