aboutsummaryrefslogtreecommitdiff
path: root/pixelterm
diff options
context:
space:
mode:
authorjaseg <s@jaseg.de>2013-07-30 13:33:07 +0200
committerjaseg <s@jaseg.de>2013-07-30 13:43:23 +0200
commit5e763123f87422e00810bacc0346936a2ae52d3d (patch)
treedb51c86622847e6e46dd1687cba90a71b7d72cc7 /pixelterm
parent76579920ef33af869ed9c643234fdb4a3dfbd7a1 (diff)
downloadpixelterm-5e763123f87422e00810bacc0346936a2ae52d3d.tar.gz
pixelterm-5e763123f87422e00810bacc0346936a2ae52d3d.tar.bz2
pixelterm-5e763123f87422e00810bacc0346936a2ae52d3d.zip
Removed standard colors 0-15 for portability. Removed pygments dep. Fixed setup.py
Diffstat (limited to 'pixelterm')
-rwxr-xr-xpixelterm36
1 files changed, 0 insertions, 36 deletions
diff --git a/pixelterm b/pixelterm
deleted file mode 100755
index 79c9cd2..0000000
--- a/pixelterm
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-
-import os, sys, argparse, os.path, json
-import pixelterm
-from multiprocessing import Pool
-from PIL import Image, PngImagePlugin
-
-def convert(f):
- img = Image.open(f).convert("RGBA")
- if args.output_dir:
- print(f)
- foo, _, _ = f.rpartition('.png')
- output = os.path.join(args.output_dir, os.path.basename(foo)+'.pony')
- metadata = json.loads(img.info.get('pixelterm-metadata'))
- comment = metadata.get('_comment')
- if comment is not None:
- del metadata['_comment']
- comment = '\n'+comment
- else:
- comment = ''
- metadataarea = '$$$\n' +\
- '\n'.join([ '\n'.join([ k.upper() + ': ' + v for v in metadata[k] ]) for k in sorted(metadata.keys()) ]) +\
- comment + '\n$$$\n'
- with open(output, 'w') as of:
- of.write(metadataarea)
- of.write(pixelterm.termify_pixels(img))
- else:
- print(pixelterm.termify_pixels(img))
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser(description='Render pixel images on 256-color ANSI terminals')
- parser.add_argument('image', type=str, nargs='*')
- parser.add_argument('-d', '--output-dir', type=str, help='Output directory (if not given, output to stdout)')
- args = parser.parse_args()
- p = Pool()
- p.map(convert, args.image)