A small piece of code that recolors an image using the coloring style of another image.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
business-colors.npy
business-colors.png
business.jpg
logo.png
lotus-colors.npy
lotus-colors.png
lotus.jpg
plants-colors.npy
plants-colors.png
plants.jpg
recolor.py
requirements.txt
sunshine-colors.npy
sunshine-colors.png
sunshine.jpg
tunner.py

README.md

recolor

A small piece of code that recolors an image using the coloring style of another image.

Installation:

Download the whole repository and run the following command in the root folder:

pip install -r requirements.txt

Usage:

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/