Skip to content

Commit

Permalink
fix up031
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnv1 committed Apr 29, 2024
1 parent a739ad7 commit 236c2fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kornia/utils/image_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def rgb2short(rgb: str) -> Tuple[str, str]:
res.append(closest)
break
i += 1
_res = "".join([("%02.x" % i) for i in res])
_res = "".join([(f"{i:02.0x}") for i in res])
equiv = RGB2SHORT_DICT[_res]
return equiv, _res

Expand Down Expand Up @@ -365,7 +365,7 @@ def image_to_string(image: Tensor, max_width: int = 256) -> str:
r, g, b = image[:, y, x]
h = f"{r:2x}{g:2x}{b:2x}"
short, _ = rgb2short(h)
res += "\033[48;5;%sm " % short
res += f"\033[48;5;{short}m "
res += "\033[0m\n"
return res

Expand Down

0 comments on commit 236c2fa

Please sign in to comment.