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

@author: Alain
"""

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


blanc=[1.0,1.0,1.0]
def fond(nl,nc,color):
    F=[[color for c in range(nc)] for l in range(nl)]
    return F

""" stéganographie """

mystere = plt.imread("mystere.png")
plt.imshow(mystere)
plt.show()

nl = len(mystere)
nc = len(mystere[0])
cache = fond(nl,nc,blanc)
for l in range(nl):
    for c in range(nc):
        pixel = mystere[l][c]
        newPixel = []
        for i in range(3):
            p = pixel[i]
            octet = int(255*p)
            decal = 16*(octet%16)
            newPixel.append(decal/255)
        cache[l][c] = newPixel

plt.imshow(cache)
plt.show()