Color Transfer between Images

Standard

Recently, I read an interesting post about colour transfer between images from http://www.pyimagesearch.com/2014/06/30/super-fast-color-transfer-images/

After reading the original literature [2] by Reinhard, et al, the actual algorithm is pretty straightforward. It consists of two main parts:

  1. First is to convert the image colour space from RGB into CIE Lab space, which is closer to human visual system, and well suited for natural scenes
  2. Try to fit the colour / lab channel distribution of our target image to our source image.

And here are some of the sample output images from performing colour transfer. The source image is on the left, the middle one is the original target image, and the right one is the result of colour transfer

Screen Shot 2014-08-19 at 19.43.46

Classic example of mapping sunset to day image, utilising sample image from http://www.pyimagesearch.com/2014/06/30/super-fast-color-transfer-images/

Screen Shot 2014-08-19 at 20.10.40

An example of transferring colour between an image of ocean during the day, to the beautiful PS3 game Journey.

Screen Shot 2014-08-19 at 20.10.04

Mapping ‘Journey’ to sunset, weirdly brings out the blue.

Screen Shot 2014-08-19 at 20.05.00

As expected, transferring colour of Journey scene to MGS Phantom Pain, makes the sunset yellow

Screen Shot 2014-08-19 at 20.06.38

Another experiment using Wind Waker which is predominantly blue to ‘Journey’

Screen Shot 2014-08-19 at 20.06.57

And finally Wind Waker to MGS

The code itself is also very simple to implement. You can check my github repository for the C++ / OpenCV code to perform colour transfer over here: https://github.com/subokita/Sandbox/tree/master/ColorTransfer

References:

[1] http://www.pyimagesearch.com/2014/06/30/super-fast-color-transfer-images/

[2] http://www.thegooch.org/Publications/PDFs/ColorTransfer.pdf

Advertisements

2 thoughts on “Color Transfer between Images

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s