2017-01-30 7 views
0

私は具体的にはモバイルのスクリーンショット画像を切り詰めたいと思います。そしてそれらをpdfに順番に束ねる。ImageMagickを使用して選択画像を切り取る方法

#!/bin/sh 

desktop_path=./screenshots/desktop/ 
mobile_path=./screenshots/mobile/ 
pdf_path=./pdf/ 

convert ${desktop_path}screenshot-1.png ${desktop_path}screenshot-2.png ${desktop_path}screenshot-3.png ${desktop_path}screenshot-4.png ${desktop_path}screenshot-5.png ${desktop_path}screenshot-6.png ${desktop_path}screenshot-7.png ${desktop_path}screenshot-8.png ${desktop_path}screenshot-9.png ${desktop_path}screenshot-10.png ${desktop_path}screenshot-11.png ${desktop_path}screenshot-12.png ${desktop_path}screenshot-13.png -chop 0x0 ${mobile_path}screenshot-1.png ${mobile_path}screenshot-2.png ${mobile_path}screenshot-3.png ${mobile_path}screenshot-4.png ${mobile_path}screenshot-5.png ${mobile_path}screenshot-6.png ${mobile_path}screenshot-7.png ${mobile_path}screenshot-8.png ${mobile_path}screenshot-9.png ${mobile_path}screenshot-10.png ${mobile_path}screenshot-11.png ${mobile_path}screenshot-12.png ${mobile_path}screenshot-13.png ${mobile_path}screenshot-14.png -chop 0x43 ${pdf_path}packets-temp.pdf 

私はここに直面してる問題は、私はデスクトップ用-chop 0x0を定義したにも関わらず、その代わりに、それだけで、モバイル上のようなデスクトップ用43pxをチョッピングのデスクトップ用チョップをスキップしないということです。

+0

私の答えはあなたの問題を整理しました:?、その後、あなたはみじん切りしたくないものを追加もしそうなら、それをあなたの答えとして受け入れることを検討してください - 投票数の横にある緑色のチェックマーク/チェックマークをクリックしてください。そうでない場合は、私が、または他の誰かがあなたをさらに助けることができるように、何がうまくいかないと言ってください。ありがとう。 http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235 –

答えて

0
#!/bin/sh 

desktop_path=./screenshots/desktop/ 
mobile_path=./screenshots/mobile/ 
mobile_cropped_path=./screenshots/mobile/cropped/ 
pdf_path=./pdf/ 

mogrify -path ${mobile_cropped_path} -chop 0x43 ${mobile_path}*.png 

convert ${desktop_path}*.png ${mobile_cropped_path}*.png ${pdf_path}packets-temp.pdf 
1

あなたは、チョップは、いくつかの画像に適用したいあなたは括弧で細断し、ちょうどそれらをチョップたいものを入れていない場合は、次の

convert NoChop.png \(ChopMe.png ChopMeToo.png -chop 10x10 \) ... 

それとも、あなたが最初に刻んたいものをロードし、それらをチョップ

convert ChopMe.png ChopMeToo.png -chop 10x10 NoChop.png ... 
関連する問題