First of all let me say I know white balancing a JPEG file or any processed image in general is not a new idea.
I simply wanted to apply the theoretical concepts about
linear edition and white balance to try to correct a wrong white balance obtaining a result as close to what we would have obtained if the image had been properly white balanced at RAW development, without leaving Photoshop.
White balance implementation is actually an exposure correction of at least 2 of the RGB channels of the image, so I will just convert the wrong white balance image into a linear profile and individually correct exposure of the RGB channels to correct it. In the end the image will be again de-linearized for proper additional edition.
We start from a crazy white-balanced image (JPEG):
1. Convert image to 16 bits to avoid shadow posterization in the next operations
2. Linealize the image from the currect colour profile to some linear profile (linear versions of common profiles can easily be generated just by setting gamma=1.0 in PS). Find
here linear versions of both sRGB and Adobe RGB.
3. With a curve mask layer, we set the white point in any neutral (R=G=B ) area of the original scene. This is a weak point of the method since not all images have truly neutral elements; in those cases some manual trials will be necessary.
In my image I took the white wall in the background:
4. To avoid the burnt areas that the curves produced, we create another curve mask layer and set it between the image and the curve mask layer created in the previous section:
This new curve will be another straigt line to reduce exposure until we get no burnt areas:
5. The last action will be put all layers and image together (CTR+E) and convert again to the desired output profile. This will gamma correct again the image and this is needed since Photoshop is not adequate for linear edition.
The image will now be properly white balanced and ready to be edited to get the best of it:
NOTE: added after discussion in this thread: the image does not need to be linear to correctly apply the WB correction. Any true gamma* colour profile is ready for a proper WB so steps get reduced to:
1. Convert image to 16 bits to avoid shadow posterization in the next operations
2. With a curve mask layer, we set the white point in any neutral (R=G=B ) area of the original scene. This is a weak point of the method since not all images have truly neutral elements; in those cases some manual trials will be necessary.
3. To avoid the burnt areas that the curves produced, we create another curve mask layer and set it between the image and the curve mask layer created in the previous section
* Only if the original image is sRGB it should be first converted to some true gamma profile (Adobe RGB would do perfect for this purpose).
Explained with more detail in (Spanish):
BALANCE DE BLANCOS JPEG.
BR