/** * Trims the white border around an image. * * @param img * @return a new image, hopefully trimmed. */ public static BufferedImage trimWhiteSpace(BufferedImage img, int whiteThreshold, int startTop, int startRight, int startBottom, int startLeft) { return trimWhiteSpace(img, img, whiteThreshold, startTop, startRight, startBottom, startLeft); }
/** * Trims the white border around an image. * * @param img * @return a new image, hopefully trimmed. */ public static BufferedImage trimWhiteSpace(BufferedImage img) { return trimWhiteSpace(img, 250, 0, 0, 0, 0); }
/** * Trims the white border around an image. * * @param img * @return a new image, hopefully trimmed. */ public static BufferedImage trimWhiteSpace(BufferedImage img) { return trimWhiteSpace(img, 250, 0, 0, 0, 0); }
/** * Trims the white border around an image. * * @param img * @return a new image, hopefully trimmed. */ public static BufferedImage trimWhiteSpace(BufferedImage img, int whiteThreshold, int startTop, int startRight, int startBottom, int startLeft) { return trimWhiteSpace(img, img, whiteThreshold, startTop, startRight, startBottom, startLeft); }
img = ImageUtils.trimWhiteSpace(img); // trims white space
if (!paramField.startsWith("sf")) { BufferedImage img = ImageIO.read(new URL(paramUrl).openStream()); img = ImageUtils.trimWhiteSpace(img);
img = ImageUtils.trimWhiteSpace(img);