2008-12-02 54 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