BufferedImage (ScaleContext context, double width, double height, int type, @NotNull PaintUtil.RoundingMode rm) { if (StartupUiUtil.INSTANCE.isJreHiDPI(context)) { return new HiDPIImage(context, width, height, type, rm); } else { //noinspection UndesirableClassUsage return new BufferedImage(rm.round(width), rm.round(height), type); } }