Adjust brightness and contrast of BufferedImage in Java

后端 未结 1 1331
终归单人心
终归单人心 2020-11-30 10:02

I\'m processing a bunch of images with some framework, and all I\'m given is a bunch of BufferedImage objects. Unfortunately, these images are really dim, and I

相关标签:
1条回答
  • 2020-11-30 10:47

    That was easy, actually.

    RescaleOp rescaleOp = new RescaleOp(1.2f, 15, null);
    rescaleOp.filter(image, image);  // Source and destination are the same.
    

    A scaleFactor of 1.2 and offset of 15 seems to make the image about a stop brighter.

    Yay!

    Read more in the docs for RescaleOp.

    0 讨论(0)
提交回复
热议问题