# coding=UTF-8
import win32com.client
im = win32com.client.Dispatch("ImageMagickObject.MagickImage.1")
im.convert("sf.jpg", "-fx", "(r+g+b)/3", "(", "sf.jpg", "-alpha",
"activate", "-channel", "a", "-fx",
"1-sqrt(pow(140-i,2)+pow(80-j,2))/100", ")", "-composite",
"sample1391a.png")
元画像(sf.jpg)
![PyWin32とImageMagickで描画しただんだんと白黒画像になっていくグラデーション](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmRW4W6mBOG1C3AhHqMNa0qhB7ZI7f9anQe_z38ibRb7PTAtA22yJkE840VaL0xPOoyl9Bu7MRahbP7nyu9e5sI7tDfZ4i7N5Rd7KMyagLKxK1npUYfJl1TWQO5L__NE7LFN84kQ/s320/sample1391a.png)
動作環境
Python3.1.1, Python for Windows Extensions (Build 214), ImageMagick6.5.5
No comments:
Post a Comment