This Python program takes two images and samples their color space after transforming them to L*a*b* color space which is linear, unlike RGB. This then allows the colors gradients from one image to be applied to another like a filter.
This Python program takes two images and samples their color space after transforming them to L*a*b* color space which is linear, unlike RGB. This then allows the colors gradients from one image to be applied to another like a filter.
Source, Target, Result
Source, Target, Result
To do this, the color spaces of the image must be seperated out and then multiplied by the matrix provided in this paper. This matrix is then used as a filter on the target image.
This image shows how L*a*b* color space is linear and flat, rather than having the hue being part of the gradient which can be seen as a part of the RGB color space.
RGB color space with hue as a part of it's nonlinear gradient:
Image from: https://upload.wikimedia.org/wikipedia/commons/5/53/CIExy1931_AdobeRGB.png