https://github.com/liulietlee/imagetoascii
Transforming an image to ASCII characters
https://github.com/liulietlee/imagetoascii
Last synced: 2 months ago
JSON representation
Transforming an image to ASCII characters
- Host: GitHub
- URL: https://github.com/liulietlee/imagetoascii
- Owner: LiulietLee
- Created: 2016-06-25T07:35:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T02:47:22.000Z (about 8 years ago)
- Last Synced: 2025-03-24T01:14:18.634Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 60.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImageToASCII
A model about transforming an image to ASCII characters written by Swift.
## Install
Just move the "Source/LLTransformer.swift" to your project.## Usage
You can download this project to see the simple example.```
let transformer = LLTransformer()
let yourImage = UIImage(named: "your_image_title.png")
let text = transformer.convertUIImageToText(image: yourImage, clarity: 98)
label.text = text // or some other cool things
```The **convertUIImageToText(image: UIImage, clarity: Int) -> String** function return a string and it has two arguements:
- image: The UIImage which will be converted.
- clarity: It's greater than 0 and smaller than 100. The greater the argurment, the clearer the string picture.