以下のバッチファイルを実行します。
rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.1-Q16
%im%\convert.exe sample2bg.jpg -border 10x10 ( -size 120x120 xc:none -channel RGBA -fill white -draw "rectangle 10,10 110,110" -negate -fx "p!=1?0:#F0F0F0" -blur 0x10 ) -composite -crop 100x100+10+10 sample101a.gif
元画像(sample2bg.jpg)

出力画像(sample101a.gif)

画像の端を暗くする場合は、以下のバッチファイルを実行します。
%im%\convert.exe sample7.jpg -border 10x10 ( -size 170x120 xc:none -channel RGBA -fill white -draw "rectangle 10,10 160,110" -negate -fx "p!=1?0:#404040" -blur 0x5 ) -composite -crop 150x100+10+10 sample101b.gif
元画像(sample7.jpg)

出力画像(sample101b.gif)

2008/01/04追記
Ver6.3.7では、以下のバッチファイルを実行します。
rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.7-Q16
%im%\convert.exe sample2bg.jpg -border 10x10 ( -size 120x120 xc:none -matte -channel RGBA -fill white -draw "rectangle 10,10 110,110" -negate -fx "p!=1?0:#F0F0F0FF" -blur 0x10 ) -composite -crop 100x100+10+10 +repage sample101a.gif
%im%\convert.exe sample7.jpg -border 10x10 ( -size 170x120 xc:none -matte -channel RGBA -fill white -draw "rectangle 10,10 160,110" -negate -fx "p!=1?0:#404040FF" -blur 0x5 ) -composite -crop 150x100+10+10 +repage sample101b.gif
関連項目
ImageMagickで画像の上下・左右をグラデーションで塗る
No comments:
Post a Comment