Skip to content

Instantly share code, notes, and snippets.

@astanin
astanin / matchcolors.py
Created July 18, 2011 00:09
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
from itertools import izip
import sys
def mkcurve(chan1,chan2):
"Calculate channel curve by averaging target values."
fst = lambda p: p[0]