PDF Optimization
Jun 14, 2020
Originally, AutoComic produced very large PDF files. Since I planned on using AutoComic on hundreds of comics, minimizing output filesize was a priority.
After much experimentation, I found that PDF would keep optimizations from .jpg formatted pictures but not .webp or other more modern formats. Although .jpg is not my favorite image format, I made the decision to convert all images to .jpg files and let the user select the quality.
In addition to compressing images, I also resized larger images to be only the width of the current page.
Changing the script to use actual text instead of generating text images using imagemagick also decreased filesize.
All of these optimizations made the output filesize significantly more manageable. In particular, one pdf (the one for The Adventures of Dr. McNinja) went from around 4,000 MB to nearly 400 MB, a decrease of nearly 10x!