以下のバッチを実行します。
rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.5-Q16
%im%\convert.exe sf.jpg -channel a -fx "(hue>0.47&&hue<0.69&&luminosity>0.5)?0:1" -channel rgba ( sf.jpg sample128a.png -geometry -90+50 -composite ) +swap -composite sample193a.jpg
上記バッチでは、元画像と雲の画像をあわせた画像の上に、
空の部分を透明にして合成しています。
元画像(sf.jpg)
重ねあわせ画像(sample128a.png)

出力画像(sample193a.jpg)

2008/01/04追記
ver6.3.7では、以下のバッチのように-matteを追加します。
rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.7-Q16
%im%\convert.exe sf.jpg -matte -channel a -fx "(hue>0.47&&hue<0.69&&luminosity>0.5)?0:1" -channel rgba ( sf.jpg sample128a.png -geometry -90+50 -composite ) +swap -composite sample193a.jpg
2008/07/13追記
ver6.4.0あたりからluminosityからlightnessに変わったので、以下のバッチを実行します。
rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.4.2-Q16
%im%\convert.exe sf.jpg -matte -channel a -fx "(hue>0.47&&hue<0.69&&lightness>0.4)?0:1" -channel rgba ( sf.jpg sample128a.png -geometry -90+50 -composite ) +swap -composite sample193a.jpg
No comments:
Post a Comment