Skip to content

Commit

Permalink
removed unused imports and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraflame4 committed Apr 20, 2023
1 parent 9ca8418 commit 769c4c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
10 changes: 3 additions & 7 deletions CliRenderer/__init__.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
numpy~=1.24.2
Pillow~=9.5.0
rich~=13.3.4
typer~=0.7.0
CliRenderer~=0.1.0
typer~=0.7.0
imageio~=2.27.0
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 =
Expand Down

0 comments on commit 769c4c4

Please sign in to comment.