## TP8 exercice 1

from matplotlib.pyplot import *
import matplotlib.image as mpimg
from numpy import *
import os

os.chdir("D:\Documents(D)\Bellevue\Informatique\0 - Programme 2021\Semestre_1_TP\TP8 - Traitement d'images\Programmes\images")

## Question 1

Photo=mpimg.imread("Plage.png")

# imshow(Photo)
# show()

## Question 2

# print(Photo.shape)

m,n=Photo.shape[:2]

## Question 3

# imshow(Photo[600:,:1000,:])
# show()

## Question 4

# Photo2=zeros([m,n,3])
# for k in range(3):
#     Photo2[:,:,k]=(Photo[:,:,0]+Photo[:,:,1]+Photo[:,:,2])/3
# imshow(Photo2)
# show()

## Question 5

for i in range(m):
    for j in range(n):
        Photo[i,j,1]=0
        Photo[i,j,2]=0
imshow(Photo)
show()
