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

Is it possible to turn off or lower the compression of images inside a PDF with Ghostscript when I convert to jpg?

I currently use the following:

gs \
 -q \
 -dBATCH \
 -dSAFER \
 -sDEVICE=jpeg \
 -dUseCIEColor \
 -dJPEGQ=95 \
 -r150 \
 -dTextAlphaBits=4 \
 -dGraphicsAlphaBits=4 \
 -dMaxStripSize=8192 \
 -sOutputFile=/test_dir/test-%d.jpg \
share|improve this question
up vote 2 down vote accepted

This commandline parameter


deteriorates the JPEG Quality already! To keep the original JPEG quality of images embedded in the original PDF, and to minimize quality deterioration for other parts of your PDF page objects, use


Keep in mind that JPEG is a lossy image format anyway. If your PDF pages did come with text sections, you will always lose quality, because JPEG isn't a good format to convert to if you have many small areas with sharply contrasting filled areas (such as black characters on white background are). (PNG is a better format for this.)

The next parameter you can employ to increase your output quality is for resolution:


Try this instead:


or even


(File sizes will roughly quadruple each time... but that's the price of increased quality.)

You may be better off by converting to TIFF or PNG... unless your need is for JPEG explicitly for some other reason.

share|improve this answer

You must log in to answer this question.

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