有没有办法将嵌入 pdf 的图像从 jpg/gif/whatever 转换为 png 或 gif?

Pat*_*ira 5 compression pdf png jpeg ghostscript

问题的最大部分在标题中......

我有由串联扫描文档制成的大型 pdf 文件,这些文件类似于新闻文章:文本+图像。重要的是文字,不是图片……

这就是为什么我想(根据这篇文章)将pdf中的所有图像压缩为png或gif......

感谢您的所有建议,我已经花了太多时间来尝试优化我的 Ghostscript 命令行选项 :-p

仅供参考,我当前的 Ghostscript 9.14 命令行在生产中:

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
Run Code Online (Sandbox Code Playgroud)

我得到了大约 40% 的压缩率和一些可读性,但我认为我可以通过更改图像压缩类型来提高可读性(我得到了嘈杂的 jpg 伪像......)

不,我无法增加 dpi,因为这会增加文件大小...:-)