import static org.imgscalr.Scalr.*;
public static BufferedImage createThumbnail(BufferedImage img) {
// Create quickly, then smooth and brighten it.
img = resize(img, Method.SPEED, 125, OP_ANTIALIAS, OP_BRIGHTER);
// Let's add a little border before we return result.
return pad(img, 4);
}
FastBitmap fb = new FastBitmap(bitmap);
Grayscale g = new Grayscale();
g.applyInPlace(fb);
Threshold t = new Threshold(120);
t.applyInPlace(fb);
bitmap = fb.toBitmap();
//Show the result