ImageMagick convert from pdf to jpg and vice versa

This post was written by eli on May 24, 2015
Posted Under: Linux,Software

To convert all pdfs into a jpgs with fairly good resolution (Linux, bash):

for i in *.pdf ; do convert -density 300 "$i" "${i%%.*}.jpg" ; done

Without the -density parameter, the result is pretty lousy.

To prepare a lot of image scans for printing, into a single pdf doc:

convert *.jpg -colorspace gray -contrast-stretch 1% printme.pdf

The contrast stretch is an equalization, so it works well when there’s a full page of stuff. As opposed to a small piece of paper that is scanned.

Add a Comment

required, use real name
required, will not be published
optional, your blog address