from color_matcher import ColorMatcher, __version__
from color_matcher.io_handler import load_img_file
from color_matcher.normalizer import Normalizer
# read files
img_ref = load_img_file('./tests/data/scotland_plain.png')
img_src = load_img_file('./tests/data/scotland_house.png')
# instantiate object and run process
cm = ColorMatcher()
img_res = cm.transfer(src=img_src, ref=img_ref, method='mkl')
# normalize image intensity to 8-bit unsigned integer
img_res = Normalizer(img_res).uint8_norm()
print('color_matcher v%s' % __version__)
import matplotlib.pyplot as plt
%matplotlib inline
f, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(20, 10))
ax1.imshow(img_src)
ax1.set_title("Source")
ax2.imshow(img_ref)
ax2.set_title("Reference")
ax3.imshow(img_res)
ax3.set_title("Result")
plt.show()
color_matcher v0.5.0