Change pixel color of a picture to another
in
Programming Questions
•
7 months ago
Hi,
I'm would like to change all the "black" pixel of an image into another color ( like blue for example )
So it work pretty good but there is one thing, because its a picture , there is some dark dark grey part that i would also have blue.
Maybe there a better solution to set dark grey scale to black in order to have all very dark near black part turning to blue.
I'm would like to change all the "black" pixel of an image into another color ( like blue for example )
So it work pretty good but there is one thing, because its a picture , there is some dark dark grey part that i would also have blue.
Maybe there a better solution to set dark grey scale to black in order to have all very dark near black part turning to blue.
- loadPixels();
for (int i = 0; i < width*height; i++) {
if (pixels[i] == 0xff000000) pixels[i] = 0xff0000ff; // Make black become blue
}
updatePixels();
}
1