jpg to pdf conversion retaining quality of image

p.echols at comcast.net p.echols at comcast.net
Fri Jan 13 23:02:39 UTC 2012



----- Original Message -----
> From: "Abhishek Dixit" <abhidixit87 at gmail.com>
> To: "Ubuntu user technical support, not for general discussions" <ubuntu-users at lists.ubuntu.com>
> Sent: Friday, January 13, 2012 4:49:12 AM
> Subject: jpg to pdf conversion retaining quality of image
> I am converting images to pdfs.I use imagemagick via following command
> 
> $bash convert page.jpg page.pdf

snip

> but I noticed loss of quality in the resulting pdf.Is there some way
> that I can retain the quality of pdf i.e. I want same quality in pdf
> as the image is.

I don't know about "same"  quality.  But there are two issues.  Imagemagik will try and set both jpeg compression and (IIRC) document dpi based on what it expects the output to be.  Default DPI is 72 and compression adjusted for that.   Not sure about the default PDF page size, but that could be where your quality is going.  The two command line options I would look at are density and quality.  Like this:

$ convert in.jpg -density 300 -quality 100 out.pdf

What you are telling convert is that this is to be a 300 dpi image and you want the highest possible quality (ie the least) compression.  To be truthful, I cannot recall having used both together.  I would start with just the -quality option and see if you like the output. If not, try various permutations and find one that suits you. 

You can  read more on the options here:
http://www.imagemagick.org/script/command-line-processing.php

Good luck,

-- PE




More information about the ubuntu-users mailing list