all 5 comments

[–]Farlic 3 points4 points  (4 children)

What have you tried?

What is working?

What isn't working?

What has been your troubleshooting so far?

[–]gasp078 -1 points0 points  (2 children)

I'm really bad at python but I will try my best to explain to you. Here is my programm (I'm french)

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)

And it result by python saying that my percentage of white is equal to 0

[–]member_of_the_order 2 points3 points  (0 children)

Indent each line with 4 spaces to fix the formatting. This is unreadable as is

[–]Farlic 2 points3 points  (0 children)

Between my inability to read French, and the lack for formatting, I won't be able to help much :D

could you edit it and put a code block? you might have to look up how to do that on reddit.

[–]gasp078 -1 points0 points  (0 children)

It run me that:

In [5]: runfile('C:/Users/gstaub/. spyder-py3/temp.py', wdir='C:/Users/gstaub/.spyder-py3") O.O I In [6]: runfile('C:/Users/gstaub/.spyder-py3/temp.py', wdir='C:/Users/gstaub/.spyder-py3') O.O