pts / pdfsizeopt

PDF file size optimizer
GNU General Public License v2.0
762 stars 66 forks source link

Enable different sets of image optimizer for monochrome and for non-monochrome images #70

Closed davdittrich closed 6 years ago

davdittrich commented 6 years ago

I noticed that for monochrome images jbig2 is almost always the best compressor. Since it is only for monochrome images it is not used for grey or color images.

If another image optimizer is enabled it is used for all types of images. This can be very slow. To save time I would like to enable these other image optimizer in some some cases (for e.g. for pdfs that contain many monochrome and only a few non-monochrome images) only for non-monochrome images as they are almost certainly out-performed by jbig2 for the monochrome images.

pts commented 6 years ago

Thank you for submitting this feature request!

You may specify --use-pngout=no now, the rest of the image optimizers are relatively fast. This doesn't distinguish monochrome images though.

I don't have the free time to work on this. If you send me a patch (pull request), I'll add it to pdfsizeopt.