Menu

#5 Lossy Compression of Jpeg in PDF

8.x
closed
Nikkho
2017-07-29
2016-04-30
Skibicki
No

Windows 8.1, File Optimizer 8.2.0.1427 x64, Ghostscript 9.15 - 9.19
Lossy compresion occurs on Jpeg files in PDF.

1 Attachments

Discussion

  • Nikkho

    Nikkho - 2016-04-30

    What do you mean by lossy? Do you mean DPI downsampling or JPEG quality setting changes?

     
    • Skibicki

      Skibicki - 2016-04-30

      JPEG quality. I set 'no downsampling'.

       
  • Nikkho

    Nikkho - 2016-04-30
    • status: open --> pending
    • assigned_to: Nikkho
     
  • Nikkho

    Nikkho - 2016-04-30

    Can you please file a Ghostcript ticket?
    http://bugs.ghostscript.com/

     
  • Skibicki

    Skibicki - 2016-04-30

    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"

     
  • Skibicki

    Skibicki - 2016-04-30

    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."

     
  • Nikkho

    Nikkho - 2016-04-30

    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.

     
  • Nikkho

    Nikkho - 2016-04-30
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB