Using Ghostscript to convert JPEG to PDF

Chry Cheng picture Chry Cheng · Nov 26, 2010 · Viewed 47.9k times · Source

What are the parameters that I should pass? The Ghostscript version I'm using is 8.71.

Answer

Robert Fleming picture Robert Fleming · May 1, 2013

https://gitlab.mister-muffin.de/josch/img2pdf

As mentioned by PleaseStand, GhostScript (edit: prior to v9.23) will decode the JPEG data, resulting in generation loss, as well as performance "ten to hundred" times worse than img2pdf.

Edit: Ghostscript 9.23 (2018-03-21) added a "JPEG Passthrough" capability that resolves the generation-loss/performance issue.

ImageMagick (i.e. convert) also decodes and re-encodes the images.