6/05/2018

Shave and a Haircut: Half Price


This is a post about wise practices in RPG PDF production. If you produce gaming material in PDF, you might find it useful. If you don't do production work (in particular, if you don't work regularly in Illustrator, Photoshop, InDesign or equivalent programs like InkScape, Gimp and Scribus), posts like this will be nonsense moon-language. See the left-hand sidebar to escape.


I love graphics production. I love vectors and rasters and vectorized rasters and rasterized vectors. I love fonts. I love photographs. I love pencil and charcoal and watercolor and oil. I love RGB and CMYK and HSB and the feel of Pantone swatches in my hand. I love lossy and non-lossy compression. I love all those things and more, but most of all I love using the right tool for the job, because this stuff matters to print quality, screen clarity, file size, methods of layering, palette consistency and more.

I read a lot of gaming PDFs, and my head dents a lot of desks. Many producers of gaming PDFs make an easy-to-fix mistake: they use grayscale space for purely black-and-white artwork. Alas. We are, every one of us, learning our craft. Let me help you learn one small thing that might make a huge difference in the quality of your work: the power of 1-bit rasters.

Some people call them "bitmap" images. I do, too (so does Photoshop), but that can also mean a raster image in any colorspace, so we'll be careful with that. Some people call them "pure bitmaps" or just "black-and-white" bitmaps. For clarity, I'll try to stick with "1-bit" in this article.

A 1-bit raster has no dimension of hue or saturation, and only the simplest concept of luminance. Like every raster, it's made of pixels, and every pixel is either black or white: yes or no, yin or yang, Siskel or Ebert, Kei or Yuri. No tones, no shades, no mulligans. Black, or white.

This distinguishes it from the grayscale space, which lacks color (hue and saturation) but has gradations of luminance. A layman would call either kind of image a "black and white picture," but one of them has grays.

Grayscale is generally ideal for representing soft colorless media like charcoal, ink-wash and graphite (and digital art created specifically for that space). 1-bit is generally ideal for representing hard colorless media like black ink. Basically, it's right in the name: grayscale has gray. 1-bit doesn't. If your image has meaningful grays, stick with grayscale. Grayscale is fantastic, for gray. Here are two bits of quickie digital art to demonstrate. The first one contains meaningful (or at least pretty) greys. The second contains no greys at all: every pixel is either black, or white.

Click to Embiggen, If Your Viewing Method Permits

Since these are purely digital creations, I could decide, and plan for, their destination colorspaces. When you're dealing with scans of hand-drawn illustrations, it's sometimes less about planning and more about just asking yourself: does this image have meaningful (or at least pretty) grays?

In real terms, every real-world piece of art has greys if you peer closely: even a "clean" ink-drawing will have subtle variations in the black, leftover ghosts of graphite or blue pencil used in the sketch stages, and so on. And, if you're dealing with a freelance artist over the Net, the scan they send may well contain some of these, lingering as schmutz in whatever colorspace they scanned in.

If you're actually doing an RPG book about the beauty of schmutz, then by all means, leave it grayscale, or heck, insist on full-color for the complete in-your face schmutz experience. But if an image is clearly meant to be a clean, black and white image, it belongs in clean, black-and-white raster (or vectorized raster, but that's another article for another day). If the thousands of RPG PDFs available across the Web are any indication, there are a lot of folks unaware of this distinction.

Let's consider an extreme illustrative example. Point your peepers into this folder I've prepared over on GDrive. There are two PDFs (ignore the subfolder for now). They're the same file  size (as close as I could get 'em). They're the same image size (U.S. Letter). They're both distilled from the same source image, a black-and-white fragment of a city map in progress, except one is distilled from the 1-bit version, the other from the grayscale. See the differences?

Guh.

Because grayscale is designed to handle many shades, it has a higher overhead in terms of file size, and responds well to lossy compression methods, while 1-bit has a lower overhead and is perfectly amenable to lossless compression. To get the grayscale version the same approximate size as the 1-bit version, I had to drop it from a buttery 600dpi to a foggy 83, a total pixel loss of 98%, and then subject it to super-lossy JPEG compression (excellent for grays and colors, dead-stupid for black-and-white).

"But S. John!" some may cry. "I don't care about file size! I have a fast internet connection and a stack of external hard drives! I could give two crunchy poops if an RPG book is 20 megabytes or 20 terabytes! File size is meaningless here in the shiny Buck Rogers world we live in! I'll just keep the image gray, refuse to downsample it, and apply only non-lossy ZIP compression!"

And if you're crying all of that, it sounds like you know what you're talking about with the Distiller options, so yes, you can do that. The resulting files will be huge, and it's your prerogative not to care. But, your customers might, and the differences are multiplied by the number of rasters in your book. Quite a lot of gamers are still stuck with DSL or satellite or less. And yeah, affordable storage is great, too, for those who do find it affordable.

But even if you bloat your file to the max, 1-bit images frequently print cleaner on most home or office printers, because of the way most PDF software interprets them. They also render more quickly on slow machines, especially tablets and smartphones. And judging by the many gaming PDFs I've spent time with, a lot of people care about some version of these things, because what I often see is a less-extreme echo of my example PDFs: compromised images downsampled and JPEGged to achieve some kind of more-or-less legible size, when that kind of compromise is unnecessary.

Bottom line on the basics: if a drawing is actually a for-real black-and-white drawing, producing it in 1-bit results in improved quality across the board, without compromise. You can simultaneously achieve higher resolutions, cleaner print, faster renders, clearer on-screen legibility, and smaller file sizes. There's no bad side, no gotcha, no hidden cost.

Then, there's more, as you gain some expertise. Peek at the PDF in that subfolder now, or click here directly, if you like. That's the "Grandma August" map from Uresia: Grave of Heaven. All the meaningful details in Uresia rasters, including this one, are that full buttery 600dpi. The colors aren't fancy, but they're nice enough. It prints clear and it's clear on-screen, even tolerating some zoom. It's nice. I think it's nice, anyway.

File size? One third of a meg. 335 kilobytes. Total. Boom.

Feel free to rummage your hard drive for 600dpi color images of comparable dimensions, weighing in at one third of a meg. While you're rummaging, compare the JPEG version of the Grandma August map, in that same subfolder. Nearly 8 megabytes to maintain the full quality of the image. 24 times the size of the PDF.

What does a full-color image have to do with pure black and white, anyway? And either way, how is this miracle achieved?

There's not a speck of color in the rasters used to create the PDF version. Not a bit. It's made of multiple 1-bit layers sandwiched over a single grayscale layer, and each layer has an appropriate swatch applied as a tone in InDesign ... leveraging two hidden powers of the 1-bit format. First, InDesign (and Acrobat) sees the white pixels as transparent by default, allowing for clever multi-layer bitmap effects (the home-digital equivalent of spot design) without resorting to blending modes. Second, InDesign is happy to tell Acrobat to treat the black pixels as tinted ones, making every "full color" Uresia map possible.

"It's not an illusion, your majesty. It only looks like one."

There's one more trick: I said the meaningful details are 600dpi, and they are: the text, the borders, the town symbols, the oceans: all of that is in a single 1-bit layer of pure black, and things like forest edges and dotted-line borders are in another 1-bit layer, tinted brownish-sepia on its way toward Distiller.

But the parchment background? And the darker forest-fills? I made this PDF using the same settings I used for the earlier example files, so while the 1-bit elements are 600dpi lossless, the parchment (which contains no meaningful details because it's just nonsense parchment backgroundy stuff) is 83dpi and lossy as can be: a grayscale layer tinted the same brownish-sepia (though, in fact, it could just as easily be a full-color layer like the one in the main Uresia world map; there's no significant savings for such a blobby background). In other words, I used the right tool for each job, within the same job.

If that's confusing, well, like I said: that's a sort of expanded 1-bit power awaiting your future expertise, and it's got friends. For now, please consider getting in the habit of using 1-bit files for black and white images (in Photoshop, the colorspaces are under IMAGE > MODE in most versions of the menu; Google around if you need more help). Your PDFs will be smaller, print clearer, and can have much higher resolutions. And I'll suffer a lot fewer head-desks.

I'll post more about RPG production and Best PDF Practices now and then. Drop me a line if there's something you'd like to read about.