-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on lossless compression #69
Comments
Solution was found already in 2016 by klivens I use a sort of one-liner that does the same task, but without requiring modifications of pdf.py |
Thanks for the response Dingo, it works. I'm trying to compress a pdf composed of JPG text images. I extracted them with pdfimages and used the jbig2 compression. With the lossless option I can reduce the size of the pdf from 40 to 2,5 MB, with lossless to 5,5 MB. But I see almost no difference in quality between the two outputs (both reduce quality of the original pdf). Am I doing something wrong, or these results are what is expected? Thanks again. |
@DingoDog, would you please be so kind to share your one-line solution?
@ken-huston, lossy and lossless compressions are expected to look similar, because the lossy jbig compression is good at preserving visual quality. You should be aware though that the lossy compression can also lead to letter substitutions (see https://en.wikipedia.org/wiki/JBIG2#Disadvantages). Always check your results when using lossy compression. I assume your sources are grayscale or colored jpg files. You might be able to improve final quality and file size by using a different program to convert the jpg files to black and white image files first. I often use ImageMagick with OTSU binarization, e.g.:
|
Hi,
With lossy compression I get fantastic results (more than 10 times reduction in size in a pdf made from .jpg images). Although reduction in quality is bearable, as I get so much reduction I wanted to try the lossless compression to compare the results.
From other issues I read that this is done without the -s option, but if I do that, I get this error:
I do not now how to deal with it. Any help will be very much appreciated.
The text was updated successfully, but these errors were encountered: