From d6d42a03e6db61903c6471e2fbda8ce0ace034e5 Mon Sep 17 00:00:00 2001 From: owl Date: Tue, 18 Feb 2025 18:01:50 +0700 Subject: [PATCH] new render for swastikas and other rubbish --- tgbot/shit/render.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tgbot/shit/render.py b/tgbot/shit/render.py index 17a0619..5769389 100644 --- a/tgbot/shit/render.py +++ b/tgbot/shit/render.py @@ -66,8 +66,8 @@ def render_text_on_image(input_image_path, text_to_draw, output_image_path=None, return file -WIDTH = 22 -HEIGHT = 9 +WIDTH = 29 +HEIGHT = 10 def image_to_string(image_file): @@ -79,7 +79,7 @@ def image_to_string(image_file): # Get image dimensions width, height = img.size - if width != 22 or height != 9: + if width != WIDTH or HEIGHT != 9: raise ValueError("The image must be exactly 22x9 pixels.") # Create the string representation @@ -89,9 +89,9 @@ def image_to_string(image_file): # Get the pixel value (0 for black, 255 for white) pixel = img.getpixel((x, y)) if pixel == 0: # Black pixel - pixel_string += "Ń" + pixel_string += "◌" else: # White pixel - pixel_string += "…" + pixel_string += "●" pixel_string += " " # New line for each row return pixel_string