View Issue Details

IDProjectCategoryView StatusLast Update
0015992ScribusPDFpublic2019-12-08 12:12
Reporterdavidrevoy Assigned To 
Status newResolutionopen 
PlatformLinuxOSKubuntuOS Version18.04
Product Version1.5.6.svn 
Summary0015992: [Export PDF] Allow more adjustments for JPEG compression quality

== Context ==

I'm doing a big book project (a large 8.5x11'' 200 pages high quality color, big size hardcover for the POD service Onebookshelf (of the fame for DriveThruRPG and DriveThruComic). The project has 200 A4@300ppi CMYK pictures and a Lossless ZIP-compression export weight 2.8GB. While uploading the file on the service, I discovered the publisher had a hardware limit of 800MB for book project. With sadness, I decided I'll have to use compression at export. I wrote "sadness" because a lot of comic speechbubble being raster black text on white background; any small JPG compression even 95% produces a slight unperceptible gray pixels that do not print well and produce slight fuzzy fonts and not perfect crisp text as I like (a flaw I see often from other publishers, especially webcomic on paper coming from online JPGs ). Unfortunately, taking the compression route was hard because Scribus doesn't propose a lot of options, or I should say, "doesn't expose to the user" a lot of option...
Steps To Reproduce== Problem ==

As now in 1.4x or 1.5x; One can set [Compression Method] in various presets and get info about what they do reading a tooltip (nice).
"Maximum" = 95%, "High" 85% (outch! really destructive) while "Medium" goes to not usable 75% ( meh... really printing JPGs at 75% compression, who want that?).

This wasn't helpful for my project. 95% compression still produce a too big file for the filesize budget of my printer (not by much, around 900MB); while the option under 85% are all too destructive and produces way too much noises for my art and text (and also start to decimate the color palette)...

If I could set it to 93%, I'm almost sure I would fit the budget and keep a reasonable amount of compression artifact. Also, I really think Maximum should be 100%, and then propose only from 100% to 90% (JPG starts to decimate color palette and really have perceptual issue under 90%, I personally would think that's too dangerous for a printed project)
Additional Information== Proposal ==

I would sincerely appreciate a slider widget here from 0 to 100 as one can find on JPG export of almost all apps (or a numeric field, 95% is a sane default, imo and according to a study I ran about JPG and perception of noise. Article: ).

== Workaround ==

If I read correctly, the value array are stored in "int qual[] = { 95, 85, 75, 50, 25 };" in /scribus/scimage.cpp at line 1208. One can still change the hardcoded values here, compile and export. Not really convenient, I couldn't test because my printer wants 1.4x and I have also proofreader and betatester opening the file with 1.4x...

The things I did: export lossless (2.8GB) at first and then run ghostscript to recompress all pictures inside the PDF; but this is dangerous because it might change subtle bit in the PDF compliance (eg: PDF X-1 standard, my printer complained my file wasn't PDF X-1 standard, but complained also for the cover of my book that was exported directly from Scribus so I'm not sure I should blame Gs here).

Here is my oneliner after many trial and error that compressed the result to 768MB for JPG 97% compression:

gs -sDEVICE=pdfwrite -dPDFX -dCompatibilityLevel=1.3 -sOutputFile=out.pdf -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -c ".setpdfwrite << /ColorACSImageDict << /VSamples [ 1 1 1 1 ] /HSamples [ 1 1 1 1 ] /QFactor 0.13 /Blend 1 >> /ColorImageDownsampleType /Bicubic /ColorConversionStrategy /LeaveColorUnchanged >> setdistillerparams" -f

QFactor 0.13 manages the CMYK JPG compression around 97% (0.15 is roughly similar to imagemagick 95% or Scribus "Maximum" and down 0.08 is almost JPG imagemagick 99%/100%: I extracted the picture from the PDF with libpoppler-utils CLI tools and then compared the noise with Imagemagick to get this results).

So with this workaround I was able to get better compression (less artifact) while getting smaller file-size. ( I think this test, and the documentation reveals a problem with too gigantic PDF size, but that's another issue).

That's all, sorry if it was long. but I thought it was better to tell the full story maybe and share all I tried and experimented around this issue, hoping to see a fix for that in future generation of Scribus! :-)
Tagscompression; pdf; jpeg; jpg; lossy; export; x-1



2019-12-08 12:00

manager   ~0047211

salut david

i've created a scribus branch in my repository where you can test different jpg values.

you need to set a value in file > preferences (not the document settings) and that value will be used by the pdf exporter to create the jpgs.

i've tested the two values 0 and 100 on a .sla with 1 single jpg image in there and the difference was very visible.
you can do the same test to see if the patch also works on your images.
if it does not, can you please send me a .sla with one image of yours so that i can adapt the patch?

the patch is not meant as a solution, but as a playground for you to test different compression levels, see if it's worth to ask scribus to have more, more flexible or different compression levels.

for the next week you will be able to download an appimage with the patched branch at this address:


2019-12-08 12:12

reporter   ~0047212

Merci ale!

That's so cool for the Appimage (and presence on Gitlab! even if I understand it is not official and your account only). I'll test it.

Issue History

Date Modified Username Field Change
2019-12-07 21:23 davidrevoy New Issue
2019-12-07 21:23 davidrevoy Tag Attached: compression; pdf; jpeg; jpg; lossy; export; x-1
2019-12-08 02:36 jghali Category Import / Export => PDF
2019-12-08 02:36 jghali Summary [Export PDF] [Compression Method] Allows more adjustments for "Lossy-JPEG" quality => [Export PDF] Allow more adjustments for JPEG compression quality
2019-12-08 02:37 jghali Severity tweak => feature
2019-12-08 12:00 ale Note Added: 0047211
2019-12-08 12:12 davidrevoy Note Added: 0047212