A small piece of code that recolors an image using the coloring style of another image.
Download the whole repository and run the following command in the root folder:
pip install -r requirements.txt
If I want to recolor the image "logo.png" using the color of the image "plants.jpg", I just need to run the following piece of code:
from recolor import Recolor c = Recolor('plants.jpg') # train the model to get the coloring style of "plants.jpg" c.recolor('logo.png')
After training for the first time, next time you can just load the saved model:
from recolor import Recolor c = Recolor('plants-colors.npy') # load the model c.recolor('logo.png')
For demonstrating examples or feedbacks, you may refer to https://zcao.info/2017/12/08/a-simple-code-for-recoloring-an-image-using-the-style-of-a-reference-picture/