Skip to content

nishchalb/img-ditto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

img-ditto

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.

Example Results

Transferring style from:

 from image

To this image:

to image

Results in : New York result

Transferring style from:

 from image

To this image:

to image

Results in : Forest result

Transferring style from:

 from image

To this image:

to image

Results in : portrait result

Dependencies

img-ditto has a few dependencies. Before using img-ditto, the following python packages should also be installed:

  1. [Numpy 1.8.2+] (http://www.numpy.org/)

  2. [OpenCV 2.4.8+ with Python support] (http://opencv.org/)

  3. SciPy 0.13.3+

Installation

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

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.

About

Transfer histograms from one image to another

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages