Page 2 of 2
Re: Watermarking images in multiple sub-directories
Posted: 2012-12-14T04:12:25-07:00
by philipt18
It's true that some PDFs have no resolution, when they're generate with text and scalable graphics. However, when a PDF is a scanned image, for example, it's basically just holding an embedded JPG image inside it, and that image has a resolution. So for example, if I scan a business card at 600dpi and save it as a PDF, and then convert the PDF using imagemagick it seems I would get a business-card size image at 72dpi, which would obviously be unreadable. That's what's going on here.
Re: Watermarking images in multiple sub-directories
Posted: 2012-12-14T11:52:58-07:00
by fmw42
snibgo wrote:See, for example,
Low resolution when converting small PDF to png.
As I understand it, there is no "as is" resolution for PDF files. They can be reproduced at any resolution. By default, IM doesn't supersample the pixels so it is fast, but supersampling is frequently needed for decent quality.
The real issue is when the PDF has an imbedded image. This has been discussed quite a bit on the forum. So the original poster should search the forum and read those posts.
Re: Watermarking images in multiple sub-directories
Posted: 2012-12-14T11:55:31-07:00
by fmw42
philipt18 wrote:I see in other discussions this resolution loss problem when converting from PDF to JPG. It suggests using the -density setting to counteract that. Seems odd that there is no way to get it to keep the resolution as is. If you know of a way, I would love to hear it.
Also, I noticed your mogrify command uses -format jpg, but as it's operating on *.jpg, what does that do? Thanks.
The usual way to improve PDFs is to use super sampling.
convert -density 288 image.pdf -resize 25% image.jpg
nominal density is 72, so 72*4=288 and then resize back down to 1/4=25%
The -format jpg used is to make sure all resulting images are jpg. The *.jpg could have been just * and it would try to change every type of image, not just jpg.
You may have to do one pass for every non vector format (jpg, png, tiff, bmp etc), which I think can be done in one pass for them all.
And then do another pass just for the vector formats such as pdf with changed density, though I have not tested that with the commands above.