【发布时间】:2015-02-18 10:33:38
【问题描述】:
我想转换图像,以便使用 pyocr 和 tesseract 更好地阅读它。 我要转换为 python 的命令行是:
convert pic.png -background white -flatten -resize 300% pic_2.png
使用 python Wand 我设法调整了它的大小,但我不知道如何做扁平化和白色背景 我的尝试:
from wand.image import Image
with Image(filename='pic.png') as image:
image.resize(270, 33) #Can I use 300% directly ?
image.save(filename='pic2.png')
请帮忙
编辑,这是要进行测试的图像:
【问题讨论】:
标签: python imagemagick wand