lundi 29 mars 2021

Select random pixels from image in python [closed]

I have an image of 1000 by 1000 pixels of white color. I would like to randomly select a square of 100 by 100 pixels and change its color it to green. in total, there will be 100 squares each measuring 100 by 100. Since there are 100 squares, I am thinking of looking using a for loop and range (x).e.g:

for i in range(100):

#do something

My challenge is selecting a random cell/square from this image. I was hoping you help figure this out.




Aucun commentaire:

Enregistrer un commentaire