GithubHelp home page GithubHelp logo

imagetoascii's Introduction

Intro

This is a simple, light and optimized image-to-ascii and ascii-to-image converter. It now supports image and video.

1. Image to Ascii

This conversion is implemented by mapping the intensity of pixel to characters with different shape.

Command option

-f | --file is input image path.

-s | --scale controls the output size.

-a | --aspect controls the aspect of height and width.

-w | --write-file is the output ascii txt path.

Usage

# lazy style: the default output is ${img_file}.txt
python img_to_ascii.py -f imgs/erke.jpg

# adjust sampling step, the output is larger if it is samller
python img_to_ascii.py -f imgs/erke.jpg -s 2

# complete style
python img_to_ascii.py -f imgs/erke.jpg -s "auto" -w out.txt

Samples

Notes

You can adjust the font size of text editor for better view.

2. Ascii to Image

It calls the text drawing API of PIL to implement the rendering of ascii text to image.

python ascii_to_img.py -f imgs/kenan.txt -w imgs/kenan_ascii.jpg

3. Video conversion

python ascii_art.py -f videos/kenan.mp4 -s 1 -e 360 -w res/kenan.gif -p 10 --step=10 --scale=0.25 --sampling-step=6

More videos to see BaiduYun.

imagetoascii's People

Contributors

cleardusk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

imagetoascii's Issues

make all in black

hi , i want to make the letters and symbols only in black , can i get help please !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.