Convert image to ascii.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
...
compile 'com.github.bachors:Android-Img2Ascii:1.1'
}
...
// bitmap
Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.image);
// Bitmap image = BitmapFactory.decodeFile(filename);
new Img2Ascii()
.bitmap(image)
.quality(3) // 1 - 5
//.color(true)
.convert(new Img2Ascii.Listener() {
@Override
public void onProgress(int percentage) {
textView.setText(String.valueOf(percentage) + " %");
}
@Override
public void onResponse(Spannable text) {
textView.setText(text);
}
});