Quality reduced file size in Mac OS X Preview
ColorSync makes Quartz filters.
If you use the print to PDF feature in Mac OS X, you have probably noticed that it can create some really large PDF files. This is fine as long as you are copying them to CD or DVD, but if you’re putting them on the web or sending them through e-mail, they can really cause havoc on both ends.
If you open the PDF in Preview, you can reduce the file size by doing a “Save As...” and choosing, appropriately, Reduce File Size from the Quartz Filter menu. Often, that will be fine. But the way that it reduces the file size is by saving all images as JPEGs of middle quality. Sometimes that quality will not be enough.
I just finished a Persistence of Vision tutorial, and because it’s a tutorial on using a 3-D raytracer it was full of images. The PDF file was nearly 20 megabytes. After saving it with Reduce File Size, it was down to under one megabyte... but the quality of the images was so bad that they didn’t serve to illustrate the concepts in the text.
It was obvious what was happening, and I knew that when saving JPEG files you are allowed to trade off low file size with increased quality. But there was no slider available in the Quartz Filter menu to increase the quality of the image.
The answer, it turns out, is in ColorSync Utility in the Utilities folder off of the Applications folder. ColorSync Utility can create new Quartz filters. Open up ColorSync Utility and switch to the “Filters” pane. This will list all of the filters that you currently have available.
- In the lower left, click on the “+” button. This creates a new filter.
- Give the filter a name, and press return.
- To the right of the filter’s name, choose the down arrow. A menu will pop up.
- From the pop-up menu, choose “Add Image Effects Component”, and from that menu choose “Image Compression”.
- Adjust the image compression Mode to JPEG.
- Adjust the image compression quality however you prefer.
- The next time you use Preview to “Save As...”, you'll have a new option under Quartz filters.
I’ve created a Reduced File Size High Quality and Mid-Quality as custom Quartz filters.
With the quality slider three quarters over, the file size dropped to 7.7 megabytes. This is quite a bit larger than with the slider half-way over, but not nearly the 20 megabytes of the original. And quality became a lot higher.
Filter while printing
You can also filter while printing, avoiding the need to re-open the PDF in Preview. When you go to print, pull down the menu just below “Presets” that usually says “Copies & Pages”. Choose “ColorSync”. Then choose the Quartz filter that you want. Once you’ve chosen it, you can also pull down the Presets menu and do a “Save As...” to remember these settings.
- Persistence of Vision tutorial
- A step-by-step tutorial, available under the Gnu Free Documentation License, on using the Persistence of Vision raytracer.
More Mac OS X tricks
- Stack windows on top of each other
- If you want to stack multiple windows directly on top of each other, it’s easy to do in any well-behaved application, such as Nisus Writer Pro, Safari, Mail, and even older applications like AppleWorks 6 and Microsoft Word X.
- Leopard setuid and passwd file changes
- Leopard Server introduced two major changes to two lesser-used features: setuid root script wrappers and BSD flat file authentication.
- Media duration in Python on Mac OS X
- It turns out to be very easy to get the duration of MP3 files, MPEGs, and other media files on the OS X command line.
- SilverService and Taskpaper
- SilverService is a great little app if you commonly need to repetitiously modify text. Any application that supports services will support running selected text through command-line scripts via SilverService.
- Combining multiple PDF files into a single file
- Automator allows you to combine multiple PDF files into a single file.
- Six more pages with the topic Mac OS X tricks, and other related pages
More PDF
- Calculating true three-fold PDF in Python
- Calculating a true three-fold PDF requires determining exactly where the folds should occur.
- Adding links to PDF in Python
- It is very easy to add links to PDF documents using reportlab or platypus in Python.
- Multiple column PDF generation in Python
- You can use ReportLab’s Platypus to generate multi-column PDFs in Snakelets, Django, or any Python app.
- Embedding Mako into Django
- You got Mako in my Django! You got Django on my Mako! Two great templates that template great together.
- Python PDF generation with Snakelets
- One of the things I need to do to move my current web site over to Django is be able to automatically generate PDF documents. Step is to learn how to generate PDF using Python.
- One more page with the topic PDF, and other related pages
