• Stars
    star
    130
  • Rank 277,575 (Top 6 %)
  • Language
    Ruby
  • Created almost 15 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ–ผ Sequential-art comic-strip generator written in Ruby which uses RMagick (2005)

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.

More Repositories

1

dotfiles

๐Ÿ’พย ย Ian's dotfiles, utils, and Zsh/Vim/tmux configs
Perl
673
star
2

jsgrids

๐Ÿ“ฆ ๐Ÿ” ๐Ÿ‘€ ย  A comparison tool to compare JavaScript data grid and spreadsheet libraries
TypeScript
170
star
3

langterm

๐Ÿ•น๏ธ WebGL-based VT220 emulator, made as a learning example and frontend for a text adventure
JavaScript
77
star
4

rltiles

GitHub clone of RL Tiles (graphical tileset for Roguelike games) + JSON metadata + selector
C
50
star
5

cadubi

๐ŸŽจ Creative ASCII Drawing Utility By Ian (1997)
Perl
47
star
6

ycombinator1.com

๐ŸŸง Lets you add a character to Hacker News links to add social media and OpenGraph previews for sharing on things like Slack or Twitter.
TypeScript
42
star
7

jsrobowar

๐Ÿ‘พ A port of RoboWar to the web browser using JavaScript and HTML5. (2010)
JavaScript
33
star
8

webgl-demos

๐Ÿฆ† (OUTDATED - 2011) Experiments with GLGE
JavaScript
30
star
9

aspen

๐Ÿ”Ž ๐Ÿ“– โœจ Custom, private search engine for text documents built with NextJS/React/ES6/ES7
JavaScript
30
star
10

femtostats

๐Ÿ“Š๐ŸŒ Super small, light, privacy-focused, self-hostable web statistics provider
TypeScript
20
star
11

magic8ball

๐ŸŽฑ ๐Ÿ“ฑ๐Ÿ”ฎ โœจ I wanted to see if ChatGPT could make an app for watchOS & iOS and it did
Swift
16
star
12

memorybot

๐Ÿค– An infobot-inspired Slack bot that remembers things
JavaScript
15
star
13

vim-javascript-sql

Vim plugin for highlighting SQL inside JavaScript template literals
Vim Script
13
star
14

ifhttp

๐Ÿ‘พ HTTP REST server for Z-Machine interactive fiction
JavaScript
12
star
15

statico.link

๐Ÿ”— Personal link shortener that uses an NGINX-compatible map file as a config
JavaScript
11
star
16

csvhacker

๐Ÿ›  A tool to quickly view, filter, map, and reduce CSV/TSV files in the browser. Shareable links for easy collaboration with non-engineers.
JavaScript
8
star
17

perl-test-refcard

Perl Testing Reference Card (2004)
6
star
18

ninjaui

Ninja ui
JavaScript
6
star
19

github-game

๐ŸŸฉ โœจ Win the GitHub game with artistic green squares!
JavaScript
6
star
20

glulxe-httpd

๐Ÿ‘พ HTTP+JSON Glulx (.ulx) interactive fiction server with session support
JavaScript
6
star
21

dungeonfun

๐Ÿ•น๏ธ Infinite multiplayer dungeon using HTML5 and WebSockets (2011)
CoffeeScript
5
star
22

javascript

this is my javascript library
JavaScript
2
star
23

FindFile.vim

William Lee's FindFile.vim
2
star
24

custom-css-extension

A Chrome extension that tweaks CSS for sites I want
JavaScript
2
star
25

tanks

A proof-of-concept tank game
JavaScript
2
star
26

friend-rescue

An App Engine-hosted Flash-based shooter for Facebook
ActionScript
2
star
27

the-archive-public

๐Ÿงžโ€โ™‚๏ธ Public version of The Archive, the text adventure game on langworth.com, but without secrets.
Inform 7
2
star
28

crafty-dirty-rectangles

Demos of CraftyJS dirty rectangle pull request, before and after
JavaScript
2
star
29

epson-dm-d100-perl

Perl serial display driver for the EPSON DM-D100 VFT display (2006)
Perl
2
star
30

tankles

2
star
31

route.js

JavaScript Inversion of Control container for URIs - location.hash navigation goodness
JavaScript
2
star
32

lakera-gandalf-solutions

2
star
33

snippendrop

JavaScript
1
star
34

imgur2rss

Turns Imgur things into RSS feeds
CoffeeScript
1
star
35

imgur-album-downloader

Download an entire album of images from Imgur
CoffeeScript
1
star
36

django-logging

Clone of http://code.google.com/p/django-logging/ with patches. (See commit history)
Python
1
star
37

kragnoth

๐Ÿ˜ˆ Proof-of-concept HTML5 multiplayer roguelike (2012)
CSS
1
star