Response: "Ghostscript (more particularly the pdfwrite device) does NOT 'optimise' PDF files. Ghostscript interprets the input into a series of marking operations, which are then piped to a device. The pdfwrite device then produces a PDF file based on those marking operations. The output is unrelated to the input, except for the appearance. This is discussed in more detail in the Overview in VectorDevices.htm in the Ghostscript documentation.
Because the input is fully interpreted JPEG images are decoded to a bitmap. If you then apply JPEG quantisation in the pdfwrite device the result will be a loss of quality (unsurprisingly, since JPEG Is a lossy compression scheme).
At present, your only option is to not use JPEG to compress images in the pdfwrite output.
It also worth noting the the -dPDFSETTINGS=/default overrides all the command line parameters which precede it on the command line."
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much for issuing the ticket Skibicki. I have made sure that all parameters now go after dPDFSETTINGS and tweaked it a bit. As of r460 (https://sourceforge.net/p/nikkhokkho/code/460/).
As for JPEG reencoding, there is nothing more I can do.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What do you mean by lossy? Do you mean DPI downsampling or JPEG quality setting changes?
JPEG quality. I set 'no downsampling'.
Can you please file a Ghostcript ticket?
http://bugs.ghostscript.com/
http://bugs.ghostscript.com/show_bug.cgi?id=696751
log:
[4/30/2016 4:08:44 AM] INFORMATION Source\cppMain.cpp (1729) () Return: 0. Process: C:\PROGRA~1\FILEOP~1\PLUGIN~1\gswin64c.exe -dColorImageDownsampleType=/Bicubic -dGrayImageDownsampleType=/Bicubic -dMonoImageDownsampleType=/Bicubic -dOptimize=true -dConvertCMYKImagesToRGB=true -dColorConversionStrategy=/sRGB -q -dBATCH -dNOPAUSE -dSAFER -dDELAYSAFER -dQUIET -dNOPROMPT -sDEVICE=pdfwrite -dDetectDuplicateImages=true -dCompatibilityLevel=1.5 -dPDFSETTINGS=/default -dDownsampleColorImages=false -dDownsampleGrayImages=false -dDownsampleMonoImages=false -sOutputFile="C:\Users\Joe\AppData\Local\Temp\FileOptimizer_Output_717_jpg pics.pdf" "F:\Downloads\jpg pics.pdf"
Response: "Ghostscript (more particularly the pdfwrite device) does NOT 'optimise' PDF files. Ghostscript interprets the input into a series of marking operations, which are then piped to a device. The pdfwrite device then produces a PDF file based on those marking operations. The output is unrelated to the input, except for the appearance. This is discussed in more detail in the Overview in VectorDevices.htm in the Ghostscript documentation.
Because the input is fully interpreted JPEG images are decoded to a bitmap. If you then apply JPEG quantisation in the pdfwrite device the result will be a loss of quality (unsurprisingly, since JPEG Is a lossy compression scheme).
At present, your only option is to not use JPEG to compress images in the pdfwrite output.
It also worth noting the the -dPDFSETTINGS=/default overrides all the command line parameters which precede it on the command line."
Thank you very much for issuing the ticket Skibicki. I have made sure that all parameters now go after dPDFSETTINGS and tweaked it a bit. As of r460 (https://sourceforge.net/p/nikkhokkho/code/460/).
As for JPEG reencoding, there is nothing more I can do.
If you are happy, please, consider making a donation: http://nikkhokkho.sourceforge.net/images/FileOptimizerDonate.html