libvips/python/example/try2.py

34 lines
591 B
Python
Raw Normal View History

#!/usr/bin/python
import logging
logging.basicConfig(level = logging.DEBUG)
from gi.repository import Vips
Vips.cache_set_trace(True)
try:
2014-08-29 18:33:14 +02:00
a = Vips.Image.new_from_file("/home/john/pics/babe.poop")
except Vips.Error, e:
print e
2014-08-29 18:33:14 +02:00
a = Vips.Image.new_from_file("/home/john/pics/babe.jpg")
b = Vips.Image.new_from_file("/home/john/pics/k2.jpg")
print 'a =', a
print 'b =', b
2014-08-29 18:33:14 +02:00
out = Vips.call("add", a, b)
print 'out =', out
out = a.add(b)
print 'out =', out
ones = Vips.ArrayDouble.new([1])
twos = Vips.ArrayDouble.new([2])
2014-08-29 19:14:22 +02:00
out = out.linear(ones, twos)
out.write_to_file("x.v")