Best compression, taking batches of TIFFs and really squeezing them down?

Well, I’ve been looking at my copy of Photoshop Elements 2.0 running on Mac OS X, and under the File menu is “Batch Processing”. That only lets you convert file formats and image resolutions, though. I couldn’t figure out how to get it to quantize the image using batch processing.

To do the conversions I was doing, I used the PNM tools (the home page for NetPNM is http://netpbm.sourceforge.net/) from the command-line on my Mac. For instance:


tifftopnm <screen.2.tiff | pnmquant 8 | pnmtopng >screen.3.png

Anyone familiar with Unix could write a script to convert 100,000 images in a similar manner. The tools are available for Windows if you have Cygwin installed. Cygwin is a package that adds a Unix-like interface to a Windows machine.

What is Quantize?

I haven’t used Elements, but in full-size Photoshop, you would create an action that will do all this for you. It’s just like recording an macro in office. It probably can be done in the less-expensive Elements too.

You would (after opening the image)

1: Create the new action, name action, assign keys, etc.

2: Reset the image to grayscale

3: Use Posterize to reset the image to whatever color depth you want

4: Save the image in the format you want (with any properties that the format may offer, like .tiffs with/w/o LZW, compression strength on jpegs, etc.)

5: stop the macro

6: Select batch processing, fill out what folders you want the files opened from, dumped into and how you want them named.

Easy as pie. However, I guanantee that the time it takes you to actually let the converter run is significantly greater than the transmission time you’ll save.

Someone probably should have asked this before: how large are the files that you’re using? A fax which is essentially a 75 dpi 2 color tiff can take up a variable amount depending on text, but I receive some that are only 8-12Kb! If your files are like 40+Kb, it might be worth your time to knock them down to that level.

I’m surprised that there aren’t more options coming out of an industrial-strength scanner like that.

Let me get some results posted, and additional information. I appreciate the input. You gave some leads…let me get more info and come back…

Every once and awhile my engineering degrees pay off.

This is because text has lots of sharp edges. Sharp edges have high spacial frequency components. Some of the compression in JPEG is due to throwing out some of the higher spacial frequencies. This results in the ringing (light grey borders around the text). Jpeg is also concerned with preserving the subtle color changes that you have in most photos. With black and white text you do not care about such things.

Thanks for running the test bordelond. It might be interesting to save the images to tiff with the LZW compression and see how much better PGN is over TIFF.

I also did a test similar to bordelond’s. 24 point text in paint black on white.

bmp monochrome 41,022 bytes
tiff with LZW compression from photoshop elements 4,072 bytes
png from photoshop elements 3,721 bytes
tiff without LZW compression from photoshop elements 43,186 bytes
Jpeg from paint (no options possible) 12,794 bytes

The Jpeg is definitely worse than png or tiff LZW but the jpeg compression is still very readable.

adding winzip to the equation:
tiff without compression zipped 2,867 bytes
tiff with compression zipped 3,215 bytes
png zipped 1,606 bytes
jpeg zipped 3,215 bytes