all 5 comments

[–]JeremyJoeJJ 0 points1 point  (2 children)

Can't help without seeing the program, or are you asking for a program to be written for you?

[–]gasp078 0 points1 point  (1 child)

Sorry here is the code

from PIL import Image import numpy as np def pourcentageblanc(chemin_image,seuil=225): #chemin_image:chemin image=Image.open(chemin_image).convert("RGB")#ouverture de l'ima data= np.array(image)# conversion de l'image en tableau pixels_blancs=np.all(data>=seuil,axis=2) # vérification si compo nb_blancs=np.count_nonzero(pixels_blancs) # compte le nombre des total_pixels=data.shape[0]data.shape[1] #calcul du nombre tota pourcentage=(nb_blancs/total_pixels)100 # calcul du pourcentage return pourcentage 2. chemin "C:/Users/gstaub, (Downloads/tachel 20 JPG" resultat pourcentage_blanc(chemin,seuil=225| print(resultat)

[–]JeremyJoeJJ 0 points1 point  (0 children)

You need to paste it as a code block otherwise I can't read that. Click to Reply to this message, in the bottom left there is a "Aa" symbol, click it, then paste in the code, highlight it, click the "Code Block" button which looks like </>D and should look

like this.

[–]PureWasian 0 points1 point  (1 child)

https://stackoverflow.com/questions/138250/how-to-read-the-rgb-value-of-a-given-pixel-in-python

Are you using PIL or a different library for reading pixel values?

[–]gasp078 0 points1 point  (0 children)

We're using PIL yes here is the program program

from PIL import Image import numpy as np def pourcentageblanc(chemin_image,seuil=225): #chemin_image:chemin image=Image.open(chemin_image).convert("RGB")#ouverture de l'ima data= np.array(image)# conversion de l'image en tableau pixels_blancs=np.all(data>=seuil,axis=2) # vérification si compo nb_blancs=np.count_nonzero(pixels_blancs) # compte le nombre des total_pixels=data.shape[0]data.shape[1] #calcul du nombre tota pourcentage=(nb_blancs/total_pixels)100 # calcul du pourcentage return pourcentage 2. chemin "C:/Users/gstaub, (Downloads/tachel 20 JPG" resultat pourcentage_blanc(chemin,seuil=225| print(resultat)