1

Im trying to adjust the brightness and contrast of an image in Java, ive seen that using RescaleOp is one of the easiest ways of doing this, however, no matter what I change the values to it seems to adjust the brightness and contrast at the same time but I want to adjust them independently. The code I have at the moment is:

RescaleOp rescaleOp = new RescaleOp(0.6f, 1, null); //decrease contrast
rescaleOp.filter(redImage, redImage);

But as I say, its decreasing both, anyone know how to make it so it just adjusts contrast and just adjusts brightness?

user2517280
  • 221
  • 1
  • 5
  • 14
  • There is a very similar question here: http://stackoverflow.com/questions/3433275/adjust-brightness-and-contrast-of-bufferedimage-in-java – Lokesh A. R. Dec 11 '13 at 14:42
  • Also, my guess is you do not require an offset of 1. Your scale faction of 0.6f should do the trick of contrast. I have not tried it, but this is a suggestion after reading the doc. – Lokesh A. R. Dec 11 '13 at 14:43

0 Answers0