2021-10-16 01:26:26 -04:00
|
|
|
# © OpenShot Studios, LLC
|
|
|
|
|
#
|
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
2013-10-14 18:18:34 -05:00
|
|
|
import openshot
|
|
|
|
|
|
2018-06-05 04:34:40 -04:00
|
|
|
# Create an empty timeline
|
|
|
|
|
t = openshot.Timeline(720, 480, openshot.Fraction(24,1), 44100, 2, openshot.LAYOUT_STEREO)
|
|
|
|
|
t.Open()
|
2013-10-14 18:18:34 -05:00
|
|
|
|
|
|
|
|
# lower layer
|
2018-06-05 04:34:40 -04:00
|
|
|
lower = openshot.QtImageReader("back.png")
|
2013-10-14 18:18:34 -05:00
|
|
|
c1 = openshot.Clip(lower)
|
|
|
|
|
c1.Layer(1)
|
|
|
|
|
t.AddClip(c1)
|
|
|
|
|
|
|
|
|
|
# higher layer
|
2018-06-05 04:34:40 -04:00
|
|
|
higher = openshot.QtImageReader("front3.png")
|
2013-10-14 18:18:34 -05:00
|
|
|
c2 = openshot.Clip(higher)
|
|
|
|
|
c2.Layer(2)
|
|
|
|
|
#c2.alpha = openshot.Keyframe(0.5)
|
|
|
|
|
t.AddClip(c2)
|
|
|
|
|
|
|
|
|
|
# Wipe / Transition
|
|
|
|
|
brightness = openshot.Keyframe()
|
2018-06-05 04:34:40 -04:00
|
|
|
brightness.AddPoint(1, 1.0, openshot.BEZIER)
|
|
|
|
|
brightness.AddPoint(24, -1.0, openshot.BEZIER)
|
2013-10-14 18:18:34 -05:00
|
|
|
|
|
|
|
|
contrast = openshot.Keyframe()
|
|
|
|
|
contrast.AddPoint(1, 20.0, openshot.BEZIER)
|
|
|
|
|
contrast.AddPoint(24, 20.0, openshot.BEZIER)
|
|
|
|
|
|
2018-06-05 04:34:40 -04:00
|
|
|
reader = openshot.QtImageReader("mask.png")
|
|
|
|
|
e = openshot.Mask(reader, brightness, contrast)
|
2013-10-14 18:18:34 -05:00
|
|
|
e.Layer(2)
|
|
|
|
|
e.End(60)
|
|
|
|
|
t.AddEffect(e)
|
|
|
|
|
|
2018-06-05 04:34:40 -04:00
|
|
|
reader1 = openshot.QtImageReader("mask2.png")
|
|
|
|
|
e1 = openshot.Mask(reader1, brightness, contrast)
|
2013-10-15 00:45:23 -05:00
|
|
|
e1.Layer(2)
|
|
|
|
|
e1.Order(2)
|
|
|
|
|
e1.End(60)
|
|
|
|
|
#t.AddEffect(e1)
|
|
|
|
|
|
2013-10-14 18:18:34 -05:00
|
|
|
for n in range(1,25):
|
2018-06-05 04:34:40 -04:00
|
|
|
print(n, end=" ", flush=1)
|
2013-10-14 18:18:34 -05:00
|
|
|
t.GetFrame(n).Save("%s.png" % n, 1.0)
|