UIImage/NSImage -> ASCII art
Swift Ruby
Switch branches/tags
Clone or download
nickswalker Update to Swift 4
Minor source changes required
Bump Cocoapods version
Fix some permissions issues with test resources
Latest commit c526f4a Dec 28, 2017
Permalink
Failed to load latest commit information.
Example Update to Swift 4 Dec 29, 2017
Pod Update to Swift 4 Dec 29, 2017
Tests Update to Swift 4 Dec 29, 2017
_Pods.xcodeproj Update to Swift 4 Dec 29, 2017
.gitignore Untrack example pods May 6, 2016
.travis.yml Update to Swift 4 Dec 29, 2017
ASCIIfy.podspec Update to Swift 4 Dec 29, 2017
LICENSE Initial commit Apr 17, 2016
README.md Merge branch 'develop' Jan 22, 2017

README.md

ASCIIfy

CI Status Version License Platform

Turn images to ASCII art. UIImage and NSImage extensions included.

Installation

ASCIIfy is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ASCIIfy"

Usage

You start by poking around in the included Playground. You can do a basic conversion with just a couple lines:

let font = ASCIIConverter.defaultFont.withSize(24.0)
    let outputImage = inputImage?.fy_asciiImageWith(font, colorMode: .color)

Extensions are great. You can also build a reusable ASCIIConverter object to expose fine-grain controls:

let colorConverter = ASCIIConverter(lut: ColorLookupTable())
colorConverter.font = font
colorConverter.backgroundColor = .black
colorConverter.colorMode = .color
colorConverter.columns = 20

let colorResult = colorConverter.convertImage(flowerImage)

You can even define your own lookup table to control the characters that get used. Take a look at the ColorLookupTable to get started:

let colorConverter = ASCIIConverter(lut: ColorLookupTable())
colorConverter.font = ASCIIConverter.defaultFont.withSize(30.0)
colorConverter.backgroundColor = .black
colorConverter.columns = 30

let colorConverterResult = colorConverter.convertImage(flowerImage)

To run the example iOS and macOS projects, clone the repo, and run pod install from the Example directory.

Author

ASCIIfy is a heavily modified fork of BKAsciiImage.

License

ASCIIfy is available under the MIT license. See the LICENSE file for more info.