val canvas = Canvas(blackAndWhiteBitmap) canvas.drawBitmap(blackAndWhiteBitmap, 0f, 0f, paint) return blackAndWhiteBitmap } private fun getBlue(img: Bitmap, x: Int, y: Int): Int = img.getPixel(x, y) and 0xff // From http://stackoverflow.com/questions/4240490/problems-with-dct...