2008-12-02 84 views

回答

1

这里是一个封装提到的接触片功能S.Lott的功能。

#!/usr/bin/env python 

import os, os.path 
from contactsheet import make_contact_sheet 

def make_film_strip(fnames, 
        (photow,photoh), 
        (marl,mart,marr,marb), 
        padding): 
    return make_contact_sheet(fnames, 
           (1, len(fnames)), 
           (photow,photoh), 
           (marl,mart,marr,marb), 
           padding) 

它假设recipe保存为contactsheet.py。用法是:

fstrip = filmstrip.make_film_strip(filmstrip.fnames, (120, 120), (0,0,0,0), 0) 
fstrip.save('/path/to/file.format') 

经过测试。

4

你会不会这样? Use PIL to make a "contact sheet" of images

也许这里还有其他人更接近你想要什么:http://code.activestate.com/recipes/tags/graphics/

+0

这是类似的东西,但这是复杂的,我想要一个单列“图像列表”,并需要从一个文件夹加载图像。我想可以修改该脚本来做到这一点。 – espenhogbakk 2008-12-02 19:26:51

+0

我的想法是,行号始终为0.基于此,您可以大大简化这一操作。 – 2008-12-02 19:39:28