I am trying to change the saturation of a specific image in Java. I already know how to edit the hue and brightness of a pixel, but I donโt understand how to do it. Here's the loop that I use to cycle through each of the pixels if you need to know that. I know this is bad for performance, but it is temporary. Loop:
for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { int pixel = image.getRGB(x, y); int r = (pixel >> 16) & 0xFF; int g = (pixel >> 8) & 0xFF; int b = (pixel) & 0xFF;
In short, I'm not sure how to change the pixel saturation, but I want to know how to do this. The loop that I use above works fine, so there is no problem. Thank you !: D
source share