libvips/python/example/try4.py

23 lines
458 B
Python
Raw Normal View History

#!/usr/bin/python
import sys
2014-08-29 18:33:14 +02:00
2014-09-01 10:41:14 +02:00
#import logging
#logging.basicConfig(level = logging.DEBUG)
2014-08-29 18:33:14 +02:00
import gi
gi.require_version('Vips', '8.0')
2014-08-29 18:33:14 +02:00
from gi.repository import Vips
2014-08-29 18:33:14 +02:00
a = Vips.Image.new_from_file(sys.argv[1])
b = Vips.Image.new_from_file(sys.argv[2])
2014-09-01 16:28:55 +02:00
c = a.join(b, Vips.Direction.HORIZONTAL,
expand = True,
shim = 100,
align = Vips.Align.CENTRE,
background = [128, 255, 128])
2014-09-01 16:28:55 +02:00
c.write_to_file(sys.argv[3])