Sometimes, when I am nearly finished processing an image, I find there is a color gradient present (probably caused by poor DBE on my part). The picture below shows an example of such an image.
The image looks fine with the exception that the bottom of the image clearly has too much blue while the top of the image looks OK. What is needed is to remove some blue from the bottom of the image while leaving the top of the image unchanged. One approach is to remove a linear blue gradient from the image. This post will show how that can be done.
The image below shows an example of a linear red gradient (no green or blue in this image). The red gradient going from left to right has a value of zero on the left edge and a value of 0.5 on the right edge. This gradient would be used by subtracting it from an image that had too much red on the right side of the image.
The gradient is actually smooth. The visible brightness transitions in the above image are caused by resampling the image and then saving it at low quality to reduce the image file size for this post. How can a gradient be defined?
A gradient is defined by two quantities:
(1) The direction in which the color gradient problem is increasing.
The picture below shows the coordinate system used to define the gradient direction. The red gradient shown in the picture above is at an angle of zero degrees. In the original image, at the top of this post, the color gradient problem increases in the direction toward the bottom of the image, i.e., at an angle of 270 deg..
(2) The magnitude of the gradient.
The magnitude of the gradient is the maximum value that the gradient increases to. The magnitude = 0.5 for the red linear gradient shown above.
Removing a Color Gradient
The original picture in this post had a blue gradient at an angle of 270 deg, i.e., that increases going towards the bottom of the picture. If that gradient can be removed the picture should look better! I have created a Process Icon that will remove a color gradient (the Process Icon can be downloaded using the link at the bottom of this post). The icon is used as follows:
I found that Chroma = 2, Theta = 270 and M = 0.15 produced a nice result for the original image in this example. The corrected image is shown below where the excess blue has been removed.
I only use this process icon occasionally, but, really appreciate it when it is needed.
NOTE: A color gradient can be added to an image by using a negative value for M.
Link for process icon:
https://www.dropbox.com/s/yierhrrvobbz43p/Gradient Remover.xpsm?dl=0
Steve
The image looks fine with the exception that the bottom of the image clearly has too much blue while the top of the image looks OK. What is needed is to remove some blue from the bottom of the image while leaving the top of the image unchanged. One approach is to remove a linear blue gradient from the image. This post will show how that can be done.
The image below shows an example of a linear red gradient (no green or blue in this image). The red gradient going from left to right has a value of zero on the left edge and a value of 0.5 on the right edge. This gradient would be used by subtracting it from an image that had too much red on the right side of the image.
The gradient is actually smooth. The visible brightness transitions in the above image are caused by resampling the image and then saving it at low quality to reduce the image file size for this post. How can a gradient be defined?
A gradient is defined by two quantities:
(1) The direction in which the color gradient problem is increasing.
The picture below shows the coordinate system used to define the gradient direction. The red gradient shown in the picture above is at an angle of zero degrees. In the original image, at the top of this post, the color gradient problem increases in the direction toward the bottom of the image, i.e., at an angle of 270 deg..
(2) The magnitude of the gradient.
The magnitude of the gradient is the maximum value that the gradient increases to. The magnitude = 0.5 for the red linear gradient shown above.
Removing a Color Gradient
The original picture in this post had a blue gradient at an angle of 270 deg, i.e., that increases going towards the bottom of the picture. If that gradient can be removed the picture should look better! I have created a Process Icon that will remove a color gradient (the Process Icon can be downloaded using the link at the bottom of this post). The icon is used as follows:
- Open the process icon and then open the Symbols tab. There are three parameters that must be set to define the color gradient in your image: Chroma, Theta and M.
- Chroma defines the color of the gradient to be removed:
- Red = 0
- Green = 1
- Blue = 2
- For our example Chroma = 2 (blue).
- Theta defines the direction in which the required correction is increasing (0 - 359 deg)
- For our example Theta = 270 deg.
- M defines the magnitude of the gradient to be removed.
- Trial and error works well for this parameter. More on this below.
I found that Chroma = 2, Theta = 270 and M = 0.15 produced a nice result for the original image in this example. The corrected image is shown below where the excess blue has been removed.
I only use this process icon occasionally, but, really appreciate it when it is needed.
NOTE: A color gradient can be added to an image by using a negative value for M.
Link for process icon:
https://www.dropbox.com/s/yierhrrvobbz43p/Gradient Remover.xpsm?dl=0
Steve
Last edited: