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.)
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
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.