imagemagickでTeX用の図をグレースケールに変換する

imagemagickではデフォルトの変換の解像度が低いので

  • unitsと-densityで解像度を指定する.

http://superuser.com/questions/479197/i-want-to-change-dpi-with-imagemagick-without-changing-the-actual-byte-size-of-t
変換コマンド

$ convert -colorspace gray -units PixelsPerInch -density 300 color.pdf gray.pdf

color下にあるイメージをグレースケールに変換してgray下に置く.

ls color/*.pdf | xargs -n 1 echo |sed -e 's/^.*\///g' | xargs -n 1 -I '{}' convert -colorspace gray -units PixelsPerInch -density 300 color/{} gray/{}