2013-05-14 87 views

回答

2

您可以将append()单张图片发送到Image.sequence列表。例如:

from wand.color import Color 
from wand.image import Image 


with Image(width=32, height=32, background=Color('red')) as ico: 
    with Image(width=16, height=16, background=Color('green')) as s16: 
     ico.sequence.append(s16) 
    ico.save(filename='multisized.ico') 

结果(multisized.ico):

multisized.ico

0

我也有类似的问题,但与创建多个JPEG文件多页的PDF。在Imagemagick中我使用了命令-adjoin。在魔杖我做了以下内容:

from glob import glob 
from wand.image import Image 

files = glob('*.jpg') 
with Image() as orig: # create empty Image object 
    for f in files: 
     page = Image(filename=f) 
     orig.sequence.append(page) 
    orig.save(filename='result.pdf')