img-ditto is a small python script with a command line interface that allows you to transfer the color style from one image to another. It works by using the histogram matching technique on the channels of an image. Example outputs are shown below.
Transferring style from:
To this image:
Transferring style from:
To this image:
Transferring style from:
To this image:
img-ditto has a few dependencies. Before using img-ditto, the following python packages should also be installed:
-
[Numpy 1.8.2+] (http://www.numpy.org/)
-
[OpenCV 2.4.8+ with Python support] (http://opencv.org/)
Once the dependencies are installed, clone the repository. At this point, you can choose to either use img-ditto as a normal script, or you can make it work globally by adding the cloned repository to your PATH, or by moving img-ditto to somewhere in your path.
usage: img-ditto [-h] [-o OUTPUT] [-s STRENGTH] [-c COLORSPACE]
from_im to [to ...]
Transfer the style from one image to another using histogram distributions
positional arguments:
from_im The image who's style you want to use
to The image(s) you want to transfer the style to
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
The suffix to append to the output files
-s STRENGTH, --strength STRENGTH
The strength of the transfer, should be between 0.0
and 1.0. Defaults to 0.8
-c COLORSPACE, --colorspace COLORSPACE
The colorspace to use for the transformation.
Currently supported are rgb, hsv, and lab. Defaults to
lab.