Logging this here from an issue raised in the Wikimedia Phabricator system concerning the rendering of a page scan stored in PDF:- https://phabricator.wikimedia.org/T256848#6272386 As suggested in the Phabricator ticket, the concerns is that the output from Ghostscript is missing portions of the original, or generating undesirable artefacts. The same PDF when viewed in the PDF viewer in Firefox Nightly showed no artefacts, So I am wondering if they are using a slightly different decoding approach or are scaling differently sized layers in a different way that generates a subjectively better image.
Created attachment 19410 [details] Simplified sample file: a6.pdf This is a simplified page 9 of the sample file. A high quality, 150 dpi, anti-aliased image can be produced by Ghostscript with the following command line: ~/ghostpdl/debugbin/gs -r600 -sDEVICE=tiffscaled24 -dDownScaleFactor=4 -o hifi.tiff a6.pdf Ghostscript has no downscaling options for other devices, but TIFF can be converted to other raster formats using "convert".
Since Peter's suggestion produces a high quality result, closing this bug as FIXED, assuming that the Phabricator users can use this approach. I will mention that 'convert' (part of ImageMagick) can scale as well as convert formats, but since this requires creation of an intermediate file as well, it uses more disk space for the intermediate file than the approach Peter suggests. I also suggest that Artifex's other Open Source product, Mupdf, can be used to produce a high quality document in JPEG format in a single step: mutool draw -r150 -o a6.jpg a6.pdf The mupdf engine (mutool is part of the Mupdf package), anti-aliases internally by default so the results are similar to using -dDownScalFactor with Ghostscript.
Created attachment 19766 [details] a6.jpg Output from: mutool draw -r150 -o a6.jpg a6.pdf