项目作者: zhoudaxia233

项目描述 :
A tool for converting images or videos or webcam feed to ASCII
高级语言: Python
项目地址: git://github.com/zhoudaxia233/PyAscii.git
创建时间: 2018-06-02T11:46:35Z
项目社区:https://github.com/zhoudaxia233/PyAscii

开源协议:MIT License

下载


PyAscii

Some Amazing examples

1. A Beautiful Girl drawed by me
2. Famous Yaoming’s Face
3. My Avatar


To do list

  • Asciify an image into txt & html
  • Asciify a video
  • Improve ascii video quality (by thresholding???)
  • Asciify webcam feed

Requirements

  1. Python >= 3.6
  2. opencv-python >= 4.0.0 (It will automatically be installed when you install pyascii)

Installation

Install pyascii:

  1. pip install pyascii

Usage

1. Asciify an image

  1. pyascii avatar.png

You can use -s or --scaling_ratio to specify the scaling ratio of the output with respect to the input image. The default value is 0.5.

  1. pyascii avatar.png -s 0.1

You can use -o or --output_format to specify the format of the output file.

0 represents for .txt format
1 represents for .html format
2 represents for both .txt format & .html format

The default value is 1.

  1. pyascii avatar.png -o 0

You can use -lh or --line_height to specify the height of each line of ascii characters in the output file. The default value is 0.65.

Note: It only works for html format output.

  1. pyascii avatar.png -lh 0.65

You can use -fs or --font_size to specify the font size of ascii characters in the output file. The default value is 5.

Note: It only works for html format output.

  1. pyascii avatar.png -fs 8

2. Asciify a video

  1. pyascii demo.mp4

You can use -s or --scaling_ratio to specify the scaling ratio of the output with respect to the input. The default value is 0.5.

  1. pyascii demo.mp4 -s 0.1

3. Asciify your webcam feed

  1. pyascii webcam

You can use -s or --scaling_ratio to specify the scaling ratio of the output with respect to the input. The default value is 0.5.

  1. pyascii webcam -s 0.1