如何在python中实现ImageMagick中提供的textcleaner函数?

时间:2017-06-01 12:55:07

标签: python-2.7 opencv image-processing imagemagick python-imaging-library

我想对我的图片进行更改,并希望实现ImageMagick中存在的一些功能。我怎样才能在Python中做同样的事情?有可用的python绑定吗?

这是imagemagick中textcleaner的链接。 http://www.fmwconcepts.com/imagemagick/textcleaner/index.php

1 个答案:

答案 0 :(得分:2)

Textcleaner是我的剧本。

要从Python运行任何(ImageMagick)bash shell脚本,您必须使用子进程模块。这方面的一个例子是How to call a shell script from python code?

下面是一个示例,您可以在终端窗口中输入或输入PHP exec()命令或从python子进程模块中输入。

输入:

enter image description here

textcleaner -g -e stretch -f 25 -o 10 -s 1 twinkle.jpg result.jpg

enter image description here