public static @NotNull Image resize(@NotNull Image image, int size, @NotNull ScaleContext scaleContext) {
    Image hidpiImage = ensureHiDPI(image, scaleContext);
    int scaledSize = (int)scaleContext.apply(size, USR_SCALE);
    return scaleImage(hidpiImage, scaledSize, scaledSize);
  }
public static @NotNull Image resize(@NotNull Image image, int size, @NotNull ScaleContext scaleContext)