April 7th, 2010

CBZ Files as Image Archives

Last fall, I gathered a stack of Alma-Tadema's paintings from my pre-1923 images folder, wrapped them up into a ZIP file, and sent them to a friend who was looking for a copyright-free color cover for a novel. Some weeks ago, I learned that the CBZ (Comic Book Zip) file format is nothing more than a ZIP file with a different extension. I downloaded and installed a free CBZ reader called Comical. After changing the extension on the Alma-Tadema archive to .cbz, I double-clicked on it, and boom! There it was, beautifully presented and trivially easy to click through. And if you change the extension back to .zip, you can de-archive the images in the usual fashion using any ZIP-capable archiver. It's all in the extension; no changes to the binary archive need to be made.

Not being a comics guy, I'd never heard of the CBZ format, though it's been around since 2004. It's basically an ebook reader protocol (since it is, after all, simply an ordinary ZIP archive) that opens a .zip file and displays the files in alpha order by filename. If the files are displayable as images, the reader displays them. If the files are not displayable as images, a well-behaved reader will ignore them. (Comical, one of the simplest free readers, sometimes crashes when it encounters a non-image binary.) If you need an indicia page, some readers will display text if it's in an .nfo file. The .nfo will appear in a separate text window on opening the file, rather than in the page display area.

I've tested four free CBZ readers: ComicRack and Comical under Windows, and QComicBook and Comix under Linux. All but ComicRack are open-source. ComicRack is overkill in a lot of ways, though it works very well. (It requires the .NET framework, if that's significant to you.) Comical is much simpler, and my only gripes are that it doesn't display .nfo files, and it crashes when it finds certain kinds of non-displayable files in a .cbz archive. QComicBook is a Qt4/KDE app, and the one I find myself using under Linux. Comix (a Python app) works well but is not as capable as QComicBook. (Feature-wise, it's on a par with Comical.) Others exist. Okular will open CBZ files without complaint, but it simply scrolls vertically through the images without attempting to show one per click.

Most of the comic book readers also read CBR and CBT files, which are RAR and TAR archives, respectively, and work almost exactly the same way. (I haven't tested those formats.)

The CBZ system works best when all the images in the archive are the same dimensions and aspect ratios. I'm putting together some photo albums for showing the folks back home that are collections of digital photographs in one (big) .cbz file. The bigness is mostly unavoidable, since JPG files don't compress very well. Still, it makes file management simpler

Here are some sample CBZ archives that I put together for testing: Alma-Tadema (14 MB). Hi-Flier Kite Catalog 1977 (6 MB). The "Elf" Space-Charge Receiver (1.7 MB).