python-lottie  0.6.10+dev2509936
A framework to work with lottie files and telegram animated stickers (tgs)
load_image.py
1 #!/usr/bin/env python3
2 import sys
3 import os
4 sys.path.insert(0, os.path.join(
5  os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
6  "lib"
7 ))
8 from lottie.utils import script
9 from lottie import objects
10 from lottie import Point, Color
11 
12 
13 image_filename = os.path.join(
14  os.path.dirname(os.path.abspath(__file__)),
15  "blep.png"
16 )
17 
18 last_frame = 60
19 an = objects.Animation(last_frame)
20 
21 image = objects.assets.Image().load(image_filename)
22 an.assets.append(image)
23 
24 an.add_layer(objects.ImageLayer(image.id))
25 
26 script.script_main(an)
lottie.utils
Definition: __init__.py:1