Image (Image image, int width, int height) { if (width <= 0 || height <= 0) return image; if (image instanceof JBHiDPIScaledImage) { return ((JBHiDPIScaledImage)image).scale(width, height); } return Scalr.resize(toBufferedImage(image), Scalr.Method.QUALITY, Scalr.Mode.FIT_EXACT, width, height, (BufferedImageOp[])null); }