Image Processing For A Digital Comic

My process for creating my books has gotten increasingly more complicated. Currently, I'm using Python (and assorted binaries) to turn 24-bit PNGs into highly-optimized 8-bit PNGs (with file sizes rivaling jpeg and webp). I'm going with PNGs because it's a good format for images that are predominately flat colored, so if your images have a lot of gradients or details, a format like JPEG would work better. The steps are as follows...
  • Saving out of Adobe Illustrator as a 24-bit PNG
  • Running a Python script on each image where:
    • the unnecessary chunks are removed
    • the image is quantized using libimagequant (results are better than Adobe's)
    • the resulting palette is optimized (palette reduction) by removing similar colors, increasing black and white point contrasts slightly and RGB value averaging. This process is obviously lossy but within tolerances I set
    • a hidden watermark is added, which is text from a 5-bit table converted to pixels (looks similar to a QRCode)
    • the PNG is recompressed using advPNG (w/zopfli setting @ 50 iterations)
    • metadata is injected as tEXt and zTXt chunks into the final png file
  • After this, a PHP script builds the CBR digital comic file:
    • PNGs are collected in order
    • an sfv is created with the files checksum
    • an nfo PNG (information file) and a Comicinfo XML files are created
    • files are then RARed using WinRAR with no compression (for speed and compatibility)
    • an archive comment is added to the final cbr
« Return to blog
Marc Hansen
Marc Hansen

Cartoonist and creator of Ralph Snart Adventures, Weird Melvin and Doctor Gorpon. Hansen has done most of his work for NOW Comics, but has also done work for Marvel, Disney and Kitchen Sink Press.

Ralph Snart Adventures was published from 1986-1993 by now defunct NOW Comics, and was the longest running comic in the entire NOW catalog, selling an average of 50,000 copies a month during that nine year period. Over two million comics were published, and it was the first indy comic to receive the Comics Code.

Today, Marc Hansen publishes Ralph Snart Adventures as an ebook on a sporadic basis. Current issues are available on his website. Keep up with Ralph Snart on Twitter and Facebook.

Ralph Snart is a registered trademark. Copyright 2024 by Marc Hansen.