from PIL import Image from urllib3.connectionpool import xrange listofpinks = [(255,105,180), (255,20,147), (219,112,147), (199,21,133)] aantal = 0 ja = 0 getalvanjanpieter = 0 getalvanjanpieter = str(getalvanjanpieter) bee = open('bee', 'r').readlines() bee = bee[0].split(' ') shrek = open('shrek', 'r').readlines() print(shrek) shrekk = [shrek[n].split for shrek[n] != '\n' and n in range(0, len(shrek))] print(shrekk) img = Image.open('test.jpg', 'r') for pixel in img.getdata(): # print(pixel) if pixel[0] > 220 and pixel[2] <= 228 and pixel[2] >= 120: # print("ja") ja += 1 else: pass aantal += 1 procent = (ja / aantal) * 100 if procent > 2: # print("er is roze in de kelder!") # bee pass else: print("er is geen roze in de kelder!")