I have a photo and I know what RGB coordinates a pixel in that photo should actually have. Based on that information, how do I correct the entire photo?

  • \$\begingroup\$ There is a common phrase "RGB values" to (represent values 0,0,0 for black or 255,255,255 for white) perhaps this is what you mean instead of "RGB coordinates" \$\endgroup\$
    – Aaron
    Commented Mar 31, 2017 at 17:46
  • \$\begingroup\$ Do you want to change the RGB values for a single pixel, or do you want to change all pixels with a certain RGB value to a different RGB value? \$\endgroup\$ Commented Mar 31, 2017 at 18:24
  • \$\begingroup\$ @DavidRouse neither. I basically want to do "white balance" but say for green. Now in the picture I have a pixel that I expect to be green and I know exactly how green it's supposed to be (rgb value). Based on that I want to correct (shift) the entire photo. \$\endgroup\$
    – Sparkler
    Commented Mar 31, 2017 at 18:33
  • \$\begingroup\$ Paint Shop Pro had a command to do this, I use it all the time. I think it was taken out of later versions though. \$\endgroup\$ Commented Mar 31, 2017 at 19:07
  • 1
    \$\begingroup\$ Is this RAW, jpeg, or some other format? The file format, sensor, and other factors will likely affect accuracy. Also, recording capabilities in color areas is different than in neutral areas. For example, some images may be off only in the reds. This is why color checkers contain a variety of color patches. \$\endgroup\$
    – Aaron
    Commented Mar 31, 2017 at 19:55

2 Answers 2


If you have a pixel in the image with RGB values (x, y, z) and want to bring it to (x', y', z'), simply use the Channel Mixer to apply the difference. It's available in both GIMP and Photoshop (and probably most editors).

There is a good chance though, that you won't be pleased with the outcome as the input information isn't to much to go on.


You aren't going to get it exactly right with a single pixel, though you can certainly get that pixel right and then adjust everything else to be visually pleasing (which is usually close enough).

To get the color more correct, assuming the light is a continuous spectrum (e.g. sunlight or incandescent bulb) you could get pretty close with a known-white pixel and a known black pixel, because the known-white pixel will tell you the color of the lighting and the known-black pixel will tell you how far off your black point is. But to get it exactly right, you would need at least several known non-grey pixels to determine how broad the spectrum is.

For discontinuous spectra (fluorescent lighting, LED lighting, mixed lighting), etc., you would pretty much need to shoot photo of a series of continuous color charts with various brightnesses (i.e. the pink-to-baby-blue chart, the light-red-to-light-blue chart ... the deep red-to-deep-blue chart), because there's no way to predict based on a small number of colors what other colors will look like.

That's not to say you can't get fairly close with a much smaller number of color samples, of course, even with a discontinuous spectrum. You can get reasonably close with a known sample of black, white, (medium) red, and (medium) green (for example). More data points is better (assuming you're willing to take the time to calibrate for all of them).

A couple of articles that explain more:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.