Skip to content

bachors/Android-Img2Ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android-Img2Ascii

Android Arsenal Release

Convert image to ascii.

Gradle

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

Usage

...

// 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);
      }
   });

Demo

demo