我想在 python 中为我正在处理的 Django 项目做等效的 this (ruby 代码)。我想在文件夹中制作 X 个图像的 filmstrip image

最佳答案

这是一个包装 的函数,其中提到的联系表 函数 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')

测试。

关于python - 如何从图像文件夹在python中生成幻灯片图像?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/334827/

10-16 23:58
查看更多