Skip to content

Commit abce472

Browse files
committed
fmt image_to_ascii.py
1 parent 228f385 commit abce472

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/image_to_ascii.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
w, h = image.size
6363
pixels = image.load()
6464

65-
outputImage = Image.new("RGB", (charWidth * w, charHeight * h), color=(0, 0, 0))
65+
outputImage = Image.new(
66+
"RGB", (charWidth * w, charHeight * h), color=(0, 0, 0))
6667
draw = ImageDraw.Draw(outputImage)
6768

6869

@@ -79,14 +80,15 @@ def getSomeChar(h):
7980
r, g, b = p[0], p[1], p[2]
8081
grey = int((r / 3 + g / 3 + b / 3))
8182
pixels[j, i] = (grey, grey, grey)
82-
draw.text((j * charWidth, i * charHeight), getSomeChar(grey), fill=(r, g, b))
83+
draw.text((j * charWidth, i * charHeight),
84+
getSomeChar(grey), fill=(r, g, b))
8385
print(getSomeChar(grey), end="")
8486
print("")
8587

8688
if charHeight > 25 or charWidth > 40:
8789
print(
8890
"WARNING: Custom resolution exceeds maximum 25*40 (height*width). See: \n"
89-
"https://github.com/o2sh/onefetch/blob/master/CONTRIBUTING.md#ascii-logo"
91+
"https://github.com/o2sh/onefetch/blob/main/CONTRIBUTING.md#ascii-logo"
9092
)
9193

9294

0 commit comments

Comments
 (0)