ラインを4本引くと、きれいに四角が描ける。
$ convert -stroke red -strokewidth 30 -draw " > stroke-linecap square > line 400,300 800,300 > line 800,300 800,800 > line 800,800 400,800 > line 400,800 400,300 > " src.jpg dst.jpg
- http://www.geocities.jp/damyarou/subIMdraw.html
- Aggressive Engineer: ImageMagickのconvertコマンド > drawオプションの使い方 > 線の太さを変える(-strokewidth)
一筆書きで四角を描いたり、四角を描く機能で四角を描くと、線がおかしくなる
$ convert -stroke red -strokewidth 30 -fill none -draw " > stroke-linecap square > path 'M 400,300 L 800,300 800,800 L 400,800 L 400,300 Z > " src.jpg dst2.jpg $ convert -stroke red -strokewidth 30 -fill none -draw " > stroke-linecap square > rectangle 400,300 800,800 > " src.jpg dst3.jpg
ImageMagick 6.6.0-4