Conversion Tools ⇒ How to control JPG compression ratio with ps2pdf
-
- Posts: 26
- Joined: Mon Mar 09, 2009 3:19 pm
How to control JPG compression ratio with ps2pdf
My problem is this: using -dColorImageFilter=/FlateEncode gives me high-quality images, but too large according to my annoying printshop. Using /DCTEncode instead gives me a smaller file, but with too much compression of the images.
How can I control the compression ratio? I have seen that there is an option QFactor that controls this, but setting -dQFactor=0.15 doesn't change anything.
(As a side note, I also tried using pdflatex to generate a PDF directly, but then the high-quality JPG images I have get recompressed to worse quality, for a reason I also don't understand.)
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
How to control JPG compression ratio with ps2pdf
That sounds odd. AFAIK, pdflatex shouldn't do any reencoding of jpeg images. It just includes them verbatim as they are. What viewer do you use?jazzgossen wrote:As a side note, I also tried using pdflatex to generate a PDF directly, but then the high-quality JPG images I have get recompressed to worse quality, for a reason I also don't understand.
You can try direct conversion from jpg to pdf with convert from image magick or sam2p. Both should preserve the original image quality. With convert you can also control the scaling of the final image using -density option. Then use those converted images with pdflatex and see if it helps.
Cheers,
Tomek
-
- Posts: 26
- Joined: Mon Mar 09, 2009 3:19 pm
Re: How to control JPG compression ratio with ps2pdf
The quality issue with pdflatex was my fault. I had some pdf versions of some images that pdflatex chose instead of the good jpg images I thought it would choose.
sam2p looks interesting too. Thanks for the notice.
How to control JPG compression ratio with ps2pdf
Code: Select all
ps2pdf -dJPEGQ=75 input.ps output.pdf
see this tool jpeg compressor how they compressed it in balanced.