rem 環境によって変えてね
set im=C:\Progra~1\ImageMagick-6.3.7-Q16
%im%\convert.exe tree1.jpg -threshold 33000 -negate -resize 30 -fx "p>0.1?1:0" -channel rgb -matte -channel a -fx "r" -channel rgba -filter Point -resize 300 tree1.jpg -compose src_in -composite sample256a.png
上記のバッチでは、2値化した画像をモザイク調に変換し、それをマスクとして画像を切り取っています。
元画像(tree1.jpg)

出力画像(sample256a.png):黒い部分は透過するPNG画像です。

No comments:
Post a Comment