butteredtoast / img2txt

Image to Ascii Text with color support. Dead simple, something useless. written in Python

Home Page:http://hit9.github.io/img2txt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

img2txt

Image to Ascii Text. Dead simple, something useless.

Just a toy

DEMOs

The following picture: foo.jpg (230x354)

  1. img2txt.py foo.jpg > 1.html : demo

  2. img2txt.py foo.jpg --color > 2.html : demo

  3. img2txt.py foo.jpg --color --fontSize=1 > 3.html : demo

  4. img2txt.py foo.jpg --color --fontSize=1 --maxLen=354 > 4.html : demo

Installation

$ virtualenv venv
$ . venv/bin/activate
(venv)$ pip install git+git://github.com/hit9/img2txt.git@master

Usage

Usage: img2txt.py <imgfile> [--maxLen=<maxLen>] [--fontSize=<fontSize>] [--color]

sample usage:

img2txt.py me.jpg --maxLen=100  --fontSize=3 --color > me.html

the optional arguments:

--maxLen             max length of the result,default:100
--color              if in color, default:False
--fontSize           the font-size(px) of text in the html,default:7

Warning

Use browsers to look colored html may cause a big memory usage.

Hack!

For instance , you have some pic: foo.jpg, and its size: axb, suppose a>b.

now, img2txt.py foo.jpg --maxLen=a --fontSize=1 --color > foo.html

see foo.html in chrome or firefox, It looks like a picture!

WhyHTML

Because it looks good in html.

License

BSD, short and sweet.

About

Image to Ascii Text with color support. Dead simple, something useless. written in Python

http://hit9.github.io/img2txt/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%