code: public String convert(BufferedImage image, boolean favicon) {
          // Reset statistics before anything
          statsArray = new int[12];
          // Begin the timer
          dStart = System.nanoTime();
          // Scale the image
          image = scale(image, favicon);
          // The +1 is for the newline characters
          StringBuilder sb = new StringBuilder((image.getWidth() + 1) * image.getHeight());
  
          for (int y = 0; y < image.getHeight(); y++) {
              // At the end of each line, add a newline character
              if (sb.length() != 0) sb.append("\n");
              for (int x = 0; x < image.getWidth(); x++) {
                  //
                  Color pixelColor = new Color(image.getRGB(x, y), true);
                  int alpha = pixelColor.getAlpha();
                  boolean isTransient = alpha < 0.1;
                  double gValue = isTransient ? 250 : ((double) pixelColor.getRed() * 0.2989 + (double) pixelColor.getBlue() * 0.5870 + (double) pixelColor.getGreen() * 0.1140) / ((double)alpha / (double)250);
                  final char s = gValue < 130 ? darkGrayScaleMap(gValue) : lightGrayScaleMap(gValue);
                  sb.append(s);
              }
          }
          imgArray = sb.toString().toCharArray();
          dEnd = System.nanoTime();
          return sb.toString();
      }
docs: The main conversion method.
  @param image A BufferedImage containing the image that needs to be converted
  @param favicon When ico is true it will convert ico file into 16 x 16 size
  @return A string containing the ASCII version of the original image.