Fork of Hmap, an image histogram remapping script written in Python 2.7 by Anthony Kesich and Ross Goodwin. Changes source image so that source image's histogram matches target image's histogram. Requires PIL/Pillow:
$ sudo pip install Pillow
To run Hmap, cd into the directory where hmap.py is located. Ensure source and target images have the same height and width dimensions (in pixels), and place them in the directory. Run the script with 2 additional arguments (source and target image files) as shown in the following example. This version will detect if your source image is grayscale or color. The resulting image will be stored in the same directory as output.jpg
Example:
$ python hmap.py source_image.jpg target_image.jpg
Source Image:
Target Image:
Result:
Photographs by Ansel Adams
Color Source Image:
Color Target Image:
Result:
Photographs by Steve McCurry





