diff --git a/CliRenderer/__init__.py b/CliRenderer/__init__.py index 3faac49..aae912c 100644 --- a/CliRenderer/__init__.py +++ b/CliRenderer/__init__.py @@ -1,16 +1,15 @@ -import concurrent.futures import os from PIL import Image -from rich.progress import track + from rich.text import Text -import numpy.typing as npt + from CliRenderer.chartools import PixelsPerChar, split_to_char, pixels2Char from CliRenderer.colorer import color_twotone, color_char from CliRenderer.core import Flags -def render(source_: Image.Image, out_size=(170, 50),bg_intensity=1,skip_resize=False)->Text: +def render(source_: Image.Image, out_size=(170, 50), bg_intensity=1, skip_resize=False) -> Text: """ Renders a single image into unicode text. @@ -22,7 +21,6 @@ def render(source_: Image.Image, out_size=(170, 50),bg_intensity=1,skip_resize=F FinalImageSize = (PixelsPerChar[0] * out_size[0], PixelsPerChar[1] * out_size[1]) - if not skip_resize: image = source_.resize(FinalImageSize).convert("RGB") gray = source_.resize(FinalImageSize).convert("L") @@ -33,7 +31,6 @@ def render(source_: Image.Image, out_size=(170, 50),bg_intensity=1,skip_resize=F if image.size != FinalImageSize: raise ValueError("The image size does not match the output size. Cannot skip resize!") - if Flags.DEBUG: os.makedirs("./build", exist_ok=True) image.save("./build/resized.png") @@ -48,6 +45,5 @@ def render(source_: Image.Image, out_size=(170, 50),bg_intensity=1,skip_resize=F char_row += pixels2Char(cell) chars.append(char_row) - string = color_char(image, chars, mask, bg_intensity) return string diff --git a/requirements.txt b/requirements.txt index 4948def..d2dd901 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ numpy~=1.24.2 Pillow~=9.5.0 rich~=13.3.4 -typer~=0.7.0 \ No newline at end of file +CliRenderer~=0.1.0 +typer~=0.7.0 +imageio~=2.27.0 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index a863f27..60be126 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = CliRenderer -version = 0.1.0 +version = 0.1.1 author = ultraflame4 description = A CLI tool to render unicode art in the terminal long_description = file: README.md @@ -14,7 +14,10 @@ install_requires= numpy~=1.24.2 Pillow~=9.5.0 rich~=13.3.4 + CliRenderer~=0.1.0 typer~=0.7.0 + imageio~=2.27.0 + [options.entry_points] console_scripts =