From 42c152013f76163c574fe225aa71364f908ecb37 Mon Sep 17 00:00:00 2001 From: Skullheadx <704277@pdsb.net> Date: Sat, 24 Dec 2022 13:08:20 -0500 Subject: [PATCH] finished --- setup.py | 10 +++++++--- text_art.py | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index d1c192a..c15d2c0 100644 --- 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]) diff --git a/text_art.py b/text_art.py index 8cb26e1..20bd7d8 100644 --- a/text_art.py +++ b/text_art.py @@ -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) -- 2.54.0