How to decrease .pdf size without losing quality Background

I want to decrease size of the .pdf filled with images.
In Preview in can be dome through Export and set Quartz Filter-&gt; Reduce File Size before saving.



Problem

The file indeed decreased from ~30MB to 0.37MB. 

But the result has such poor quality that images are barely readable.

Question

I saw an examples of using Image Magic to achieve that - but can it be done by Preview without any external software?
The problem is - the default filter used during conversion has very low conversion settings.

Thankfully, a custom filter can be added.

Adding custom filter step by step


Create new directory (if you don't have it) - /Library/Filters
Add there new filter file with unique filter - f.e. Reduce Size with good quality.qfilter
The file should contain XML with new filter - you can base on the /System/Library/Filters/Reduce File Size.qfilter file or use my below example. Change compression setting, image size and add unique display name for your filter.


Filter file structure/example


I marked key settings by comments.

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Domains&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;Applications&lt;/key&gt;
        &lt;true/&gt;
        &lt;key&gt;Printing&lt;/key&gt;
        &lt;true/&gt;
    &lt;/dict&gt;
    &lt;key&gt;FilterData&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;ColorSettings&lt;/key&gt;
        &lt;dict&gt;
            &lt;key&gt;DocumentColorSettings&lt;/key&gt;
            &lt;dict&gt;
                &lt;key&gt;CustomLHSCorrection&lt;/key&gt;
                &lt;array&gt;
                    &lt;integer&gt;8&lt;/integer&gt;
                    &lt;integer&gt;8&lt;/integer&gt;
                    &lt;integer&gt;8&lt;/integer&gt;
                &lt;/array&gt;
            &lt;/dict&gt;
            &lt;key&gt;ImageSettings&lt;/key&gt;
            &lt;dict&gt;
                &lt;key&gt;Compression Quality&lt;/key&gt;
    &lt;!-- ====== Set your custom quality &lt;0,1&gt; ======= --&gt;
                &lt;real&gt;0.75&lt;/real&gt;
                &lt;key&gt;ImageCompression&lt;/key&gt;
                &lt;string&gt;ImageJPEGCompress&lt;/string&gt;
                &lt;key&gt;ImageScaleSettings&lt;/key&gt;
                &lt;dict&gt;
                    &lt;key&gt;ImageScaleFactor&lt;/key&gt;
    &lt;!-- ====== Set your scale factor &lt;0,1&gt; ======= --&gt;                 
                    &lt;real&gt;0.75&lt;/real&gt;
                    &lt;key&gt;ImageScaleInterpolate&lt;/key&gt;
                    &lt;true/&gt;
    &lt;!-- ====== Set what sizes your images can reach ======= --&gt;                    
                    &lt;key&gt;ImageSizeMax&lt;/key&gt;
                    &lt;integer&gt;1684&lt;/integer&gt;
                    &lt;key&gt;ImageSizeMin&lt;/key&gt;
                    &lt;integer&gt;1200&lt;/integer&gt;
                &lt;/dict&gt;
            &lt;/dict&gt;
        &lt;/dict&gt;
    &lt;/dict&gt;
    &lt;key&gt;FilterType&lt;/key&gt;
    &lt;integer&gt;1&lt;/integer&gt;
    &lt;key&gt;Name&lt;/key&gt;
&lt;!-- ====== Set unique display name for your filter ======= --&gt;
    &lt;string&gt;Reduce Size Good Quality&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Result

Select your new filter when exporting file.





Helpful articles:


https://www.macworld.com/article/1168311/software/shrink-preview-files-without-ruining-image-quality.html