Skip to content

Instantly share code, notes, and snippets.

@wmoreland
wmoreland / matchcolors.py
Last active August 22, 2019 11:27 — forked from astanin/matchcolors.py
Match colors of the second image to the colors of the first image.
"""Usage: python matchcolors.py good.jpg bad.jpg save-corrected-as.jpg"""
from scipy.misc import imread, imsave
from scipy import mean, interp, ravel, array
import sys
def mkcurve(chan1,chan2):
"Calculate channel curve by averaging target values."
fst = lambda p: p[0]
snd = lambda p: p[1]