Skip to content
forked from hit9/img2txt

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

License

Notifications You must be signed in to change notification settings

sdustinh/img2txt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published