35.13 Converting Images

20200423 ImageMagick provides considerable functionality for image conversion. Below we include some examples.

To convert from pdf to png a -denisty of 300 and -resize 50% seems to work well:

$ convert -density 300 myimg.pdf -resize 50% myimg.png

This may fail due to an ImageMagick security policy when the GhostScript interpreter is being used as in the handling of pdf files. You may like to research the risk and then override the policy by editting /etc/ImageMagick-6/policy.xml to comment out the appropriate policy line:

$ sudo emacs /etc/ImageMagick-6/policy.xml

  <!-- policy domain="coder" rights="none" pattern="PDF" / -->


Your donation will support ongoing development and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.