Write to 16 bit BufferedImage TYPE_USHORT_GRAY
问题 I'm trying to write 16 bit grayscale imagedata to a png using BufferedImage.TYPE_USHORT_GRAY. Normally I write to an image like so: BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); then: image.setRGB(x,y,Color.getRGB); to set the pixels, and finally: ImageIO.write(image, "png", new File(path + ".png")); to write to a png image. But now I have this as image: BufferedImage imageGray = new BufferedImage(width, height, BufferedImage.TYPE_USHORT_GRAY); How do I