Wrong brightness converting image to grayscale in Java

后端 未结 2 693
暗喜
暗喜 2021-01-21 00:19

I\'m converting a image to gray scale in Java with the following code:

BufferedImage originalImage = ImageIO.read(new File(\"/home/david/input.bmp\"));
BufferedI         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-21 00:57

    Find out the conversion formula used by Gimp. It probably takes some human color perception into account, while the Java implementation is mathematical (R+G+B)/ 3.

提交回复
热议问题