Friday, March 30, 2007

ImageMagickで左上が明るいボタンを作成する

ImageMagickで左上が明るいボタンを作成するには、
以下のバッチファイルを実行します。

rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.1-Q16
rem ボタン画像1
%im%\convert.exe -size 100x20 xc:none -fill #fad759 -stroke #ffffff -draw "roundrectangle 0,0 99,19 8,8" ( -size 100x20 xc:#f8f8ffff -channel A -fx "((w-i)/w)*((h-j)/h)*0.6+0.3" ) -composite -stroke none -fill #a0a0a0 -draw "font-size 12 text 32,15 'Search'" ( +clone -background #000000 -shadow 40x2+3+3 ) +swap -background white -mosaic sample117a.gif
rem ボタン画像2
%im%\convert.exe -size 100x20 xc:none -fill #c0c0c0 -stroke #ffffff -draw "roundrectangle 0,0 99,19 8,8" ( -size 100x20 xc:#f8f8ffff -channel A -fx "((w-i)/w)*((h-j)/h)*0.6+0.3" ) -composite -stroke none -fill #707070 -draw "font-size 12 text 32,15 'Search'" ( +clone -background #000000 -shadow 40x2+3+3 ) +swap -background white -mosaic sample117b.gif
rem 2つのボタン画像を連結
%im%\convert.exe sample117a.gif sample117b.gif +append button.gif

出力画像(button.gif)

No comments: