public static boolean isBlack(BufferedImage var0, int var1, int var2) {
        if (var0.getType() == 12) {
            WritableRaster var5 = var0.getRaster();
            int var4 = var5.getSample(var1, var2, 0);
            return var4 == 0;
        } else {
            short var3 = 140;
            return isBlack(var0, var1, var2, var3);
        }
    }
Copied and pasted from Tess4j (https://sourceforge.net/projects/tess4j/)
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-ocr-module/src/main/java/org/apache/tika/parser/ocr/tess4j/ImageUtil.java