Initial commit
This commit is contained in:
commit
2b76bfdb6b
|
@ -0,0 +1,2 @@
|
|||
*.png
|
||||
*.yuv
|
|
@ -0,0 +1,13 @@
|
|||
import glob
|
||||
import PIL.Image
|
||||
for f in glob.glob("*-a.png"):
|
||||
old = PIL.Image.open(f)
|
||||
new = PIL.Image.new("RGB", (500, 250), (0, 0, 0))
|
||||
for x in range(old.width):
|
||||
for y in range(old.height):
|
||||
try:
|
||||
new.putpixel((int(500/2) + x - int(old.width / 2), int(250/2) + y - int(old.height / 2)), old.getpixel((x, y)))
|
||||
except:
|
||||
pass
|
||||
new.save(f.replace("-a.png", "-b.png"))
|
||||
print(f)
|
|
@ -0,0 +1,6 @@
|
|||
import glob, subprocess
|
||||
f = glob.glob("*.png")
|
||||
f.sort()
|
||||
for i in range(len(f)):
|
||||
thisfile = f[i]
|
||||
subprocess.call(["mv", thisfile, str(i).rjust(3, "0") + ".png"])
|
Loading…
Reference in New Issue