# coding=UTF-8
import win32com.client
im = win32com.client.Dispatch("ImageMagickObject.MagickImage.1")
# 上下半透明グラデーション
im.convert("-size", "200x200", "xc:none", "(", "xc:#d0903080",
"xc:#10101080", "+append", "-resize", "2x1", ")", "-channel",
"rgba", "-fx", "v.p{(1-sin(pi*j/h)),1}", "sf.jpg", "+swap",
"-composite", "sample1376a.png")
# 左右半透明グラデーション
im.convert("-size", "200x200", "xc:none", "(", "xc:#d0903080",
"xc:#10101080", "+append", "-resize", "2x1", ")", "-channel",
"rgba", "-fx", "v.p{(1-sin(pi*i/w)),1}", "sf.jpg", "+swap",
"-composite", "sample1376b.png")
元画像(sf.jpg)
出力画像1(sample1376a.png)
出力画像2(sample1376b.png)
動作環境
Python3.1.1, Python for Windows Extensions (Build 214), ImageMagick6.5.5
No comments:
Post a Comment