Skip to content

naseemakhtar994/Android-Img2Ascii

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android-Img2Ascii

Release

Convert image to ascii.

Gradle

allprojects {
   repositories {
      ...
      maven { url 'https://jitpack.io' }
   }
}
dependencies {
    ...
    compile 'com.github.bachors:Android-Img2Ascii:1.0'
}

Usage

...

// bitmap
Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.image);
// Bitmap image = BitmapFactory.decodeFile(filename);

// quality
int quality = 3; // 1 - 3

// convert image(bitmap) to ascii(string)
Img2Ascii image2ascii = new Img2Ascii();
String ascii = image2ascii.convert(image, quality);

// textView.setTypeface(monospaceFont);
// textView.setText(ascii);

Demo

demo