Friday, January 18, 2008

ImageMagickで金属プレート風の画像を描画する - その2

筋の入った金属プレート風の画像を描画するには、以下のバッチファイルを実行します。

rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.7-Q16

%im%\convert.exe -size 150x100 gradient:#f5f5f5-#a3a3a3
( -size 150x100 xc:none -matte -channel RGBA -fx sin(pi*i/w)*0.1+0.9
-channel A -fx 0.5 ) -composite -stroke none
-draw "fill #909090 font-size 26 text 29,59 'Sample' fill #ffffff font-size 26
text 31,61 'Sample' fill #d0d0d0 font-size 26 text 30,60 'Sample'"
( -size 1x100 plasma:fractal -resize 150x100! -channel a -fx "0.1"
-channel rgb -fx "luminosity" ) -composite -raise 2x2 sample281.png

出力画像(sample281.png)


2008/07/13追記
ver6.4.0あたりからluminosityからlightnessに変わったので、以下のバッチを実行します。
rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.4.2-Q16
%im%\convert.exe -size 150x100 gradient:#f5f5f5-#a3a3a3 ( -size 150x100 xc:none -matte -channel RGBA -fx sin(pi*i/w)*0.1+0.9 -channel A -fx 0.5 ) -composite -stroke none -draw "fill #909090 font-size 26 text 29,59 'Sample' fill #ffffff font-size 26 text 31,61 'Sample' fill #d0d0d0 font-size 26 text 30,60 'Sample'" ( -size 1x100 plasma:fractal -resize 150x100! -matte -channel a -fx "0.1" -channel rgb -fx "lightness" ) -composite -raise 2x2 sample281.png

関連項目
ImageMagickで金属プレート風の画像を描画する

No comments: