# -*- coding: utf-8 -*-
"""
Created on Sat Nov  4 23:48:14 2017

@author: Alain
"""

import matplotlib.pyplot as plt
import matplotlib.image as img
import random as rd

""" quelques couleurs """

blanc=[1.0,1.0,1.0]
noir=[0.0,0.0,0.0]
gris=[0.5,0.5,0.5]
rouge=[1.0,0.0,0.0]
bleu=[0.0,0.0,1.0]

""" fonctions utilitaires """

def fond(nl,nc,color):
    pass


""" drapeau français """



""" drapeau japonais """



""" damier """



""" cavalier """

cavalier=img.imread("cavalier.png","png")

def rgba2rgb(image):
    nl = len(image)
    nc = len(image[0])
    rgb = fond(nl,nc,blanc)
    for l in range(nl):
        for c in range(nc):
            pixel = image[l][c]
            rgb[l][c]= [pixel[0],pixel[1],pixel[2]]
    return rgb
    
cavalier2 = rgba2rgb(cavalier)
plt.imshow(cavalier2)
plt.show()




