This is great to quickly and easily resize and "package" images to send by e-mail, for example.
Here's the basic command:
Code: Select all
$ convert *.jpg -resize 1000x1000 -compress jpeg -density 72 -units PixelsPerInch -quality 65% output.pdf
- -resize 1000x10000: Scale the image to max. 1000 pixels (width or height). Aspect ratio is preserved.
Another option might be "-resize 50%" to scale relatively.
- -compress jpeg: Apply jpeg compression (=lossy!). There are other options available.
- -quality 65%: Quality parameter for JPEG compression.
- -density 72: Set to 72 DPI. This is useful if different image sources (with different DPIs) were used. 72 is for screen-display. Use at least 300 for printing.
- -units PixelsPerInch: Without this setting, the density may not be calculated identically for image sources with different properties. If you end up with a PDF where different pages have different dimensions, try to add this
(Thanks to Stackoverflow answer by Kenny)
Thanks ImageMagick developers!