title: Is there a way to convert images embed in a pdf from jpg/gif/whatever to png or gif?
body: <p>the biggest part of the question is in the title...</p>
  
  <p>I have big pdf files made from concatenated scanned documents which are something like press articles: text+images. The important part is the text, not the pictures... </p>
  
  <p>That's why I thought (accordingly to this <a href="https://litmus.com/blog/png-gif-or-jpeg-which-ones-should-you-use-in-email" rel="nofollow">article</a>) to compress all the images in the pdf to png or gif...</p>
  
  <p>Thanks for all your propositions, I already spend too much time to try optimize my ghostscript command line options :-p</p>
  
  <p>FYI that my current ghostscript 9.14 command line in production : </p>
  
  <pre><code>gs -q -sDEVICE=pdfwrite \
     -dSAFER -dNOPAUSE -dBATCH -dQUIET -dPDFSETTINGS=/ebook \
     -dColorImageResolution=150 -dGrayImageResolution=150 -dMonoImageResolution=800 \
     -dPreserveOPIComments=false -dPreserveOverprintSettings=false \
     -dUCRandBGInfo=/Remove -dProcessColorModel=/DeviceRGB -dMaxInlineImageSize=0 \
     -dDetectDuplicateImages=true -dFastWebView=false -dUseFlateCompression=true \
     -dAutoFilterGrayImages=false -dAutoFilterColorImages=false \
     -dColorImageDownsampleThreshold=1.2 \
     -sOUTPUTFILE=/tmp/screen_20140602103745.pdf \
     -c "512000000 setvmthreshold /QFactor 0.80 /Blend 1 /ColorTransform 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2]" \
     -f /usr/bases/dicodrp/pdf/pdf_concatenes/20140602103745.pdf
  </code></pre>
  
  <p>I got about 40% compression and something <em>just readable</em>, but I think I can improve the readibility just in changing the image compression type (I got that noisy jpg artifacts...)</p>
  
  <p>No, I can't increase the dpi because that will increase the file size... :-)</p>