Cheatsheet ImageMagick
Convert a PNG file to a JPG file
convert input.png \
-density 150 \
-define jpeg:extent=500KB \
output.jpg
convert input.png \
-density 150 \
-quality 50 \
output.jpg
Convert a PDF to a series of PNG files
convert \
<your-PDF-file>.pdf \
-density 150 \
-trim \
-verbose \
page%d.png
Convert a PDF to a series of JPG files
convert \
-density 150 \
-trim \
<your-PDF-file>.pdf \
-quality 100 \
-flatten \
-sharpen 0x1.0 \
-verbose \
page%d.jpg
Compress a PDF
convert -density 120 -quality 100 -compress jpeg original.pdf output.pdf