Latest 0.3.0
Homepage https://github.com/nickswalker/ASCIIfy
License MIT
Platforms ios 8.0, osx 10.11
Dependencies KDTree
Authors

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.

Latest podspec

{
    "name": "ASCIIfy",
    "version": "0.3.0",
    "summary": "UIImage/NSImage to ASCII art",
    "description": "Includes UIImage and NSImage extensions. String and image output available.",
    "homepage": "https://github.com/nickswalker/ASCIIfy",
    "license": "MIT",
    "authors": {
        "Nick Walker": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nickswalker/ASCIIfy.git",
        "tag": "0.3.0"
    },
    "dependencies": {
        "KDTree": []
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.11"
    },
    "source_files": "Pod/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This