-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
39 lines (27 loc) · 988 Bytes
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Blending images
image1 = Image.open("demo3_1.jpg")
image2 = Image.open("demo3_2.jpg")
# Create a new image which is the half-way blend of image1 and image2
# The "0.5" parameter denotes the half-way point of the blend function.
images1And2 = Image.blend(image1, image2, 0.5)
# Save the resulting blend as a file
images1And2.save("demo3_3.jpg")
#compiled C vs Python
https://stackoverflow.com/questions/41365723/why-is-my-python-numpy-code-faster-than-c
#MP4
list_gen = []
for i in range(0, 50):
i = str(i)
if len(i) <= 1:
i = str(f'images/00{i}.png')
list_gen.append(i)
else:
i = str(f'images/0{i}.png')
list_gen.append(i)
import os
import moviepy.video.io.ImageSequenceClip
image_folder='images'
fps=10
image_files = [image_folder+'/'+img for img in os.listdir(image_folder) if img.endswith(".png")]
clip = moviepy.video.io.ImageSequenceClip.ImageSequenceClip(list_gen, fps=fps)
clip.write_videofile('my_video.mp4')