from filecmp import cmp
from turtle import title
import matplotlib.pyplot as plt

# Para fazer a plotagem de uma única imagem
def plot_image(image):
    plt.figure(figsize=(12, 4))
    plt.imshow(image, cmap='gray')
    plt.axis('off')
    plt.show()

# Para plotar resultados de combination e transformation
def plot_result(*args):
    number_image = len(args)
    fig, axis = plt.subplot(nrows=1, ncols= number_image, figsize=(12, 4))
    names_list = ['image{}'.format(i) for i in range(1, number_image)]
    names_list.append('Result')
    for ax, name, image in zip(axis, names_list, args):
        ax.set_title(name)
        ax.imshow(image, cmp='gray')
        ax.axis('off')
    fig.tight_layout()
    plt.show()

# Para plotar histogrmas para RGB de cada imagem
def plor_histogram(image):
    fig, axis = plt.subplots(nrows=1, ncols=3, figsize=(12, 4), sharex=True, sharey=True)
    color_lst = ['red', 'green', 'blue']
    for index, (ax, color) in enumerate(zip(axis, color_lst)):
        ax.set_title('{} histogram'.format(color, title))
        ax.hist(image[:,:, index].reve(), bins=256, color= color, alpha= 0.8)
    fig.tight_layout()
    plt.show()