]> Skullheadx's Git Forge - text-art.git/commitdiff
finished
authorSkullheadx <704277@pdsb.net>
Sat, 24 Dec 2022 18:08:20 +0000 (13:08 -0500)
committerSkullheadx <704277@pdsb.net>
Sat, 24 Dec 2022 18:08:20 +0000 (13:08 -0500)
setup.py
text_art.py

index d1c192a96e3812d4665b55fddc485b3427a06868..c15d2c015f675c7bd6518efbd4e9470bcc8f3a21 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -12,19 +12,19 @@ output_path = "output/"
 
 is_video = True
 
-filename = "3x14x9 4x4 Piston Door.mp4"
+filename = "Rick Astley - Never Gonna Give You Up (Official Music Video) (online-video-cutter.com).mp4"
 
 input_filename = os.path.join(input_path, filename)
 output_filename = os.path.join(output_path, filename)
-output_filename_no_audio = os.path.join(output_path, "no audio" + filename)
+output_filename_no_audio = os.path.join(output_path, "no audio " + filename)
 
 
 BLACK = (0, 0, 0)
 WHITE = (255, 255, 255)
 
 # density = "Ñ@#W$9876543210?!abc;:+=-,._       "
-# density = density[::-1]
 density = '     .:-i|=+%O#@'
+# density = density[::-1]
 density_length = len(density)
 
 font = cv2.FONT_HERSHEY_COMPLEX_SMALL
@@ -32,6 +32,10 @@ scale = 10
 font_size = 1
 thick = 1
 
+# scale = 10
+# font_size = 1
+# thick = 1
+
 
 def get_number(filename: str):
     return int(filename[5:-4])
index 8cb26e1a5fccc686250c3486f394aae52076cbad..20bd7d8dd30e2f6a5cfb16ff91d117e293e1da08 100644 (file)
@@ -32,9 +32,10 @@ def text_art_image(path: str) -> None:
         if (x % scale) or (y % scale):
             continue
 
-        if y == 0 and x > 0:
+        line += density[math.floor(find_index(image[index], 0, 255, 0, density_length - 1))]
+        if x == 0 and y > 0:
             line += '\n'
 
     # Write to txt file
-    with open(os.path.join(text_art_txts_path,f"frame{get_number(path)}.txt"), "w") as f:
+    with open(os.path.join(text_art_txts_path, f"frame{get_number(path)}.txt"), "w") as f:
         f.write(line)