minicomic
minicomic
is a library providing a set of rake rules for building print and web-ready files for minicomics from a set of SVG files.
Originally designed for generating black-and-white folio minicomics of the sort most suited for inexpensive photocopying, the most recent versions produce color output by default. If you are generating classic black-and-white minicomics, the options:
:color => :monochrome, :rasterize => false
are recommended for getting optimum quality and file sizes.
getting minicomic
minicomic
is available from Rubyforge:
www.rubyforge.org/projects/minicomic
Or via RubyGems:
sudo gem install minicomic
Development versions are available via git from repo.or.cz:
git://repo.or.cz/minicomic.git
http://repo.or.cz/r/minicomic.git
requirements
In addition to the obvious requirements for Ruby and Rake, minicomic
requires the following software to be installed and available on your shell’s path:
-
Inkscape
-
psutils
-
Ghostscript
-
ImageMagick
-
pngcrush
If you’re on Ubuntu, these correspond to the inkscape
, psutils
, gs-gpl
, imagemagick
and pngcrush
packages, respectively.
usage
The simplest way to use minicomic
is to create a Rakefile
as follows:
require 'minicomic'
minicomic '.'
minicomic
will look for pages in a pages/
folder in the given directory (in this particular case, ‘.’ meaning the directory where the Rakefile
lives). Options can be included after the directory name, for instance:
minicomic '.', :color => false
(specific options will be discussed later)
In the pages directory, minicomic
looks for SVG files named according to the following conventions:
page-NN.svg
-
page
NN
front-cover.svg
-
the front cover of the comic (optional)
back-cover.svg
-
the back cover of the comic (optional)
inside-front.svg
-
the inside front cover of the comic (optional)
inside-back.svg
-
the inside back cover of the comic (optional)
Page numbers start at 1 (page 1 is a right-handed page, and the first interior page excluding the inside cover). The exact size of page documents is not important; they will be scaled to fit the selected output format (preserving aspect ratio).
It is also possible to have two-page spreads in single files:
pages-NN-MM.svg
-
the spread spanning pages
NN
-MM
cover.svg
-
the cover (back and front together in one file; optional)
A two-page spread will be cut in half and each half placed on the appropriate page in the print output.
print output
When generating output for print, minicomic
will round the number of interior pages up to the next multiple of four, padding with blank pages as needed. The page graphics will be scaled down slightly from their full size, and smaller graphics will be centered.
print-related options
There are several options which control how minicomic’s print output is generated:
:format
-
the format for the folded booklet; options are
:half_letter
,:a5
,:b5
, or a two-element array with dimensions in postscript points (default::half_letter
) :rasterize
-
whether print output should be rasterized rather than being exported as PostScript – PostScript will usually result in smaller files, but cannot support many Inkscape features like blur or transparency (default:
true
) :margin
-
a nominal horizontal margin in PostScript points; the page images will be scaled down slightly to accomodate this margin (default:
13.5
, which is 3/16 of an inch)
The required paper format will be the double the booklet’s format, so :half_letter
requires US letter paper, :a5
requires A4 paper, and :b5
requires B4 paper.
If the pages are rasterized, then the following options also apply to print:
:color
-
true
,false
, or:monochrome
– whether the rasterized images should be full-color, greyscale, or monochrome (24-bit color, 8-bit greyscale, or 1-bit bitmap) (default:true
) :dpi
-
the target DPI for the rasterized page images (taking into account any scaling to accomodate the margins) (default:
200
)
proof output
To generate a “proof” PDF that you can examine to see what spreads will look like in the assembled comic (i.e. “reader spreads”), use:
rake proof
The PDF will be created as print/proof.pdf
. Since I rarely use the inside covers for anything, minicomic
currently places the front and back covers opposite the first and last interior pages respectively.
single-sided printing
To generate a set of PDFs suitable for single-sided printing and assembly, use:
rake single
This will generate a set of two PDFs:
print/front.pdf
-
front side of all pages
print/back.pdf
-
back side of all pages
When using the single-sided PDFs, _you will need to experiment_ to find the correct order to use them in, and the correct way to flip the paper. For my printer, I print back.pdf
first, then flip the stack the long way before printing front.pdf
on it. Other printers will differ depending on how the paper is loaded in the tray, and how it is stacked on output.
duplex printing
To generate a set of PDFs suitable for duplex printing and assembly, use:
rake duplex
This will generate a single PDF, print/duplex.pdf
.
When printing this PDF, if you’re lucky, your printer it will deposit its output pages face-down and they will be ready for assembly (this is the norm). Otherwise if it deposits its pages face-up, you will have reverse their order before you can assemble the comic.
web output
You can generate files for web upload via:
rake web
web-related options
The following options apply to web output:
:web_height
-
the height, in pixels, of images for web output (width will be determined according to the page’s aspect ratio) (default: 680)
:thumbnail_height
-
the height, in pixels, of thumbnail images (default: 96)
:color
-
whether the generated images should be 24-bit color (
true
), 8-bit greyscale (false
), or 4-bit greyscale (:monochrome
) (default:true
)
output files
When generating output for the web, minicomic
will generate a set of PNGs and a corresponding set of JPEG thumbnails:
web/page-NN.png
-
page
NN
web/thumbnail-NN.jpeg
-
thumbnail of page
NN
For spreads, the filenames are similar, except instead of a single page number NN
, a page range will be indicated as NN-MM
.
cleanup
You can easily get rid of the temporary and output files with:
rake clean
This is often a good idea if you’ve changed any of minicomic’s options, since files generated with the previous options may still be lingering.