Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have pages of handwritten notes that I decided to scan to a PDF. Somehow, 153 pages of notes turned into a 156.4 MB PDF file.

The notes are scanned in color because I used four different colors: black, red, blue, green. In fact, the only colors I really need for the document are those four (plus white). Is there a way to reduce the number of colors in the PDF file? (e.g. via a Unix command?)

share|improve this question
It might be a better idea to lower the resolution instead of messing with the colors. – ZippyV May 18 '13 at 22:21

Take a look at GhostScript.

PDFs use color depth, which may somewhat limit you in terms of specifying the exact number of colors you would like to use, however, that doesn't mean you won't be able to reduce the file size.

For -depth Ghostscript uses values of:

1 (black & white), 8 (256 colors) and 24 (true color)

Some possible options to help reduce the file size:

-dPDFSETTINGS=/screen   (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook    (low quality, 150 dpi images)
-dPDFSETTINGS=/printer  (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default  (almost identical to /screen)

example script.

share|improve this answer
Thanks for your response. I looked at and could not find how to set the depth. (I tried the example script with -depth=1 added and that did not make the output black and white.) – Alan C May 19 '13 at 1:23

for color texts, djvu is better in compression, try to extract scanned images from pdf and compress in a djvu file with


djvusolo works very well with wine in Linux

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .