Code Monkey home page Code Monkey logo

color-transfer-between-images's Introduction

Color Transfer

Color transfer is a practical method to change the appearance of a source image according to the color patternof a target image.
This program is the implementation of the paper Color Transfer between Images by Erik Reinhard, Michael Ashikhmin, Bruce Gooch and Peter Shirley.

Features

  • Read BMP file (source/target image)
  • Calculate the mean and STD of each channel
  • Implement the RGB color transfer algorithm
    • Convert images from RGB to ℓαβ color space
    • Statistics and color correction

Install Packages

pip install numpy
pip install opencv-python

If you want to create EXE file after programming, also install this:

pip install pyinstaller

Run the program

Put 6 source picture and 6 target picture inside the source_and_target folder, then execute the code:

python color_transfer.py

After that, your can find 6 result picture inside result folder.

Execute following instruction to create EXE file of this program:

pyinstaller -F color_transfer.py

Example

Source / Target / Result


References

color-transfer-between-images's People

Contributors

chia56028 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

color-transfer-between-images's Issues

The implementation uses Lab color space rather than ℓαβ color space.

Although the commentary here states that the processing implements a conversion of images from “RGB to ℓαβ color space”, this is not the case. The processing, as implemented, converts images from RGB to CIE Lab color space. (It uses the function cvtColor in association with COLOR_BGR2LAB.)

Here is an implementation in Matlab where the conversion is from RGB to ℓαβ color space.
https://github.com/hangong/reinhard_color_transfer
Here is an implementation in Python where the conversion is from RGB to CIE Lab color space.
https://github.com/pengbo-learn/python-color-transfer

It can be seen that the output image produced by the first processing method is different to that produced by the second.
The implementation presented in this repository is correct and perfectly valid, but it cannot be described as an implementation of the paper ‘Color Transfer between Images’ by Erik Reinhard, Michael Ashikhmin, Bruce Gooch and Peter Shirley. It is a variation of the method described in that paper.

Incidentally, I have implemented an enhanced CIE Lab version of color transfer here.
https://github.com/TJCoding/Enhanced-Image-Colour-Transfer

I have also attached here a file which implements in Python ‘Enhanced Image Color Transfer Processing’. It is a modification of the code that was posted here. https://github.com/jrosebr1/color_transfer
It is the only Python code I have ever written so it is not suitable for formal issue, but if anyone wishes to produce a formal version by refining the code then they are welcome to do so.

init.zip

A web app is now available here which permits a comparison of processing using the ℓαβ and the CIE Lab colour spaces.
https://www.dustfreesolutions.com/CT/CT.html

Get 3D CUBE Lut file?

Thank you very much for your excellent work with this library!

I wanted to ask, how could you export the corresponding 3D CUBE Lut file of the image with the transferred color?

Thank you very much in advance! :D

Color Transfer between two persons

Hi @chia56028 thanks for the great work, really appreciate you knowledge and understanding in Image Processing.

I'd like to use your work for the application of human skin color (skin tone) matching. I performed few experiments and found some results as follows:

Source of color to be transferred:
image

Target on which color should be transferred:
image

Non-skin pixels are made null for simplicity.

The color transferred result:
image

As, we can see the color is transferred from source image to target image but there extra unwanted blue noise. I'm quite new in this field, Can you please help me with this?
Any valuable suggestion from your side is appreciated.
Thanks again!

With Regards
Deepak Kumar Jha

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.