summaryrefslogtreecommitdiff
path: root/wpcreator/generator.py
blob: 7f22c55a7233087afa58bf94036d238397db95a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pygtk
pygtk.require ("2.0")
import gtk
import cairo

from PIL import Image

def assemble (images):
    full_width = 0
    full_height = 0
    for image in images:
        width, height = image.size
        full_width += width
        full_height = max (height, full_height)
    dest = Image.new ("RGB", (full_width, full_height))
    x = 0
    for image in images:
        width, height = image.size
        dest.paste (image, (x, 0))
        x += width
    return dest