aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpixelterm.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/pixelterm.py b/pixelterm.py
index db6227e..3ee0d85 100755
--- a/pixelterm.py
+++ b/pixelterm.py
@@ -34,17 +34,14 @@ def termify_pixels(img):
coltop = (0,0,0,0)
if colbot[3] != 255:
colbot = (0,0,0,0)
- c = '▀'
- te = fgescape
- be = bgescape
#Da magicks: ▀█▄
- if coltop == (0,0,0,0):
- c,te,be = '▄',be,te
+ c,cf = '▀','█'
+ te,be = fgescape,bgescape
+ if coltop == (0,0,0,0) or coltop == bg or colbot == fg:
+ c,cf,te,be = '▄',' ',be,te
if colbot == coltop:
- c = ' '
- out += te(coltop)
- out += be(colbot)
- out += c
+ c,te,be = cf,te,te
+ out += te(coltop) + be(colbot) + c
out += '\n'
return out