私は本当にimage-magick
もそのconvert
コマンドラインコマンドを使用していませんが。しかし、私はいくつかの調査を行い、-resize
パラメータを使用してイメージのサイズを変更できることを発見しました。詳細については、hereおよびhereおよびhereを参照してください。 subprocess
からランニングにそれを組み込むには、あなたが行うことができます:
import subprocess
#I want to pass output dimension as parameter. How do I do that
params = ['convert','./data/in.pdf','-resize', '100x100', 'thumnails.jpg'] # replace 100x100 with your width x height
subprocess.check_call(params)
また、あなたが-density
引数を使用して試すことができます:
params = ['convert', '-density', '100x100', './data/in.pdf', 'thumnails.jpg'] # replace 100x100 with your width x height
'convert'は画像-魔術コマンドラインプログラムです。 – Dark