In my grayscale picture I need to find specific value and replace it with some color, e.g yellow. Here is the code which I have right now, but it\'s not as fast as I need. I
In the case of a 4 channel image, where each pixel is 4 bytes (8-bits per channel), you can use a 256 entry lookup-table indexed by row[0] and assign all four channels simultaneously as a single 32-bit int.