1

I am stuck in a problem and dont know where to look at. I need to increase intensity of particular color in image, like R, G, or Blue. When I am doing that, certain colors are not rendering properly.

Below is the image that I took for testing: enter image description here

Now when I increase like Green color:

A = Color.alpha(p);
R = Color.red(p);
G = (int)(Color.green(p)*1.2);
B = Color.blue(p);

This is what I get: enter image description here

What can be the solution to fix those Pink patches.

Thanks

viv
  • 6,158
  • 6
  • 39
  • 54

1 Answers1

2

Ty clamping the values so that they don't go over 255. Like this:

A = Color.alpha(p);
R = Color.red(p);
G = Math.min((int)(Color.green(p)*1.2), 255);
B = Color.blue(p);
Buddy
  • 10,874
  • 5
  • 41
  • 58