所以我想把一个图像拼接成两个,为此我写了这段代码。你知道吗
from wand.image import Image
from wand.display import display
with Image(filename="test.png") as im :
im.trim(color=None,fuzz=0)
x,y = im.size
xh,yh = int(x/2),int(y/2)
print(x,y,xh,yh)
im1 = im[0:xh,0:y]
print(im1.size)
display(im1)
图像的大小是(1156242),因此拼接的图像应该是(578242),而不是(553235)。有人知道为什么吗?Here is the test image.
这就是使用
wand.image.Image.trim
的效果。只需要一个简单的“重新页面”。你知道吗我现在手头没有文档链接,但是快速搜索ImageMagick的
-repage
命令行选项应该有助于描述这个过程。你知道吗相关问题 更多 >
编程相关推荐