diff options
author | jaseg <s@jaseg.de> | 2013-04-02 02:25:55 +0200 |
---|---|---|
committer | jaseg <s@jaseg.de> | 2013-04-02 02:25:55 +0200 |
commit | fa787ab9e3ed5daae754c261424877e11aaa21c0 (patch) | |
tree | 2ada53b225abfb85e8473919fb97aec61d747a68 | |
parent | 1b765e23196931c07819b5b07fc27f10c5f5a7bd (diff) | |
download | pixelterm-fa787ab9e3ed5daae754c261424877e11aaa21c0.tar.gz pixelterm-fa787ab9e3ed5daae754c261424877e11aaa21c0.tar.bz2 pixelterm-fa787ab9e3ed5daae754c261424877e11aaa21c0.zip |
Further optimizations. Now it is good enough for me.
-rwxr-xr-x | pixelterm.py | 15 |
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 |