public static int getUserWidth(@NotNull Image image) {
    if (image instanceof JBHiDPIScaledImage) {
      return ((JBHiDPIScaledImage)image).getUserWidth();
    }
    return image.getWidth(null);
  }
public static int getUserWidth(@NotNull Image image)