# AsciiPy **Repository Path**: justfun/AsciiPy ## Basic Information - **Project Name**: AsciiPy - **Description**: 视频、图片、文字转字符画 (github克隆) https://github.com/R4yGM/AsciiPy - **Primary Language**: Python - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: https://github.com/R4yGM/AsciiPy - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-10 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AsciiPy translate images, videos and text to Ascii arts easy(轻松将图片、视频和文本转换成字符画) 本项目主要是通过控制台来显示转换后的Ascii字符集,不是通过文本、视频等其他方式 ![](https://media.giphy.com/media/WrJ7YDJhx8J5KjYmwM/giphy.gif) ## 安装 to install you have to clone the repository ```shell $ git clone https://github.com/R4yGM/AsciiPy //从github上安装,不推荐(因为网络环境太差) $ git clone https://gitee.com/justfun/AsciiPy //从本项目clone,推荐 ``` ## 依赖 ​ opencv-python>=4.1.1.26 ​ Pillow >=7.1.2 ​ urllib3>=1.25.9 ## 兼容性 在python 3.8.2中通过测试 ## Asciify in your python script to start asciifying in your script you have to import the module ```python import AsciiPy ``` ### Asciify a text in python script after you have imported the module type: ```python # text = AsciiPy.AsciiText.GenerateText(TEXT, FONT) text = AsciiPy.AsciiText() text.GenerateText("Hey", "graffiti") ``` to asciify a text ### Asciify a image from url in your python script after you have imported the module type: ```python img = AsciiPy.AsciiImage() img.GenerateFromUrl("https://r4yan.ga/images-videos/python-logo.png") ``` to asciify a image by url ### Asciify a image from path in your python script after you have imported the module type: ```python img = AsciiPy.AsciiImage() img.GenerateFromPath("images-videos/python-logo.png") ``` to asciify a image by url ### Asciify a video from path in your python script after you have imported the module type: ```python video = AsciiPy.AsciiImage() video.VideoFromPath("images-videos/cube.mp4") #this will automatically prints the video ``` to asciify a video by path ### Asciify a video from url in your python script after you have imported the module type: ```python video = AsciiPy.AsciiImage() video.VideoFromUrl("https://r4yan.ga/images-videos/cube.mp4") #this will automatically prints the video ``` to asciify a video by url ### Get list of fonts in python script after you have imported the module type: ```python # 国内就不要想了,会报链接超时的错误 lst = AsciiPy.AsciiText.FontList() print(lst) ``` this will print ove 400 different fonts you can use to generate texts ## Asciify in Terminal (需要在项目根目录下) ### Asciify a image from url to asciify a image you have to run ```shell $ py AsciiPy.py -u [url for your image] ``` example ```shell $ py AsciiPy.py -u https://r4yan.ga/images-videos/python-logo.png ``` ### Asciify a image from path to asciify a image from path you have to run ```shell $ py AsciiPy.py -p [path for your image] ``` ### Asciify a text ```shell $ py AsciiPy.py -t [text] [font] ``` if you need a font list just type ```shell $ py AsciiPy.py -f ``` ### Asciify a Video from path ```shell $ py AsciiPy.py -vid-path [path to video] ``` ### Asciify a Video from url ```shell $ py AsciiPy.py -vid-url [url to video] ``` ### help ```shell $ py AsciiPy.py -h ``` this prints a list of commands with examples still in development