Color Transfer Background Process Examples
Connor Patsel
CPSC 6040 Final
Fall 2018

Background

For this project, I chose to implement the color transfer algorithm proposed by Reinhard, et al. in their paper Color Transfer between Images. The paper describes a method to apply the color statistics of one image (the source) to another image (the destination). The destination image will then take on the appearance of the atmosphere of the source image. A limitation to this approach is that the images must be constructed similarly, i.e. images of vastly different subjects likely will not translate well. The remedy to this is to perform the algorithm on swatches of the image at a time, however this approach is beyond the scope of this project.

Additionally, this project implements a simple image scaling algorithm in order to simplify the transfer between images of differing sizes.

Process

The process involved in color transfer between a source and a destination image includes these main steps:

  • Convert from RGB space to LMS space
  • Convert from LMS space to Lαβ space
  • Color correct using image color statistics
  • Convert back to RGB space
For this project, RGB values were converted to values from [0,1].

Scale the Image

Before doing any of the steps, if the images are not the same size then the destination image is scaled either up or down. To do this, the ratio of how much bigger the source image is to the destination image is used for the value in a simple scaling kernel which is then applied to the destination image before continuing.

Convert from RGB to LMS

To convert images from pixels RGB to LMS space Reinhard et al. provide the following matrix multiplication:

After translating the pixels, they should be converted to logarithmic scale to eliminate skew. This will produce the vector LMS.

Convert from LMS space to Lαβ space

Once in LMS space the pixels can then be converted to Lαβ space. This can be achieved through the following transformation:

Color correct using statistics

Next is to collect statistic information about the images.
  1. First the mean Lαβ values are found for each image.
  2. Using the means, find the standard deviation for each image.
  3. Compute the standard deviation scale factor by dividing the source std.dev over the destination's.
  4. Subtract the destination's mean from its pixel values
  5. Scale this by the scale factor from step 3.
  6. Add the mean from the source image to the pixel.

Convert Back to RGB

Using these two equations:


Each newly adjusted pixel can be converted back into the typical RGB space.

Examples

Source Image, Destination Image, Result