Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def eqLum(pict1,pict2):
- # @pict1: Picture
- # @pict2: Picture
- # @return: Boolean; Vero se tutti i colori della prima immagine hanno un corrispettivo equiluminoso;
- #nella seconda, Falso se non esistono o non tutti lo hanno.
- allPix1 = getPixels(pict1)
- allPix2 = getPixels(pict2)
- for p1 in allPix1:
- lum1 = (getRed(p1)+getGreen(p1)+getBlue(p1))
- if existEqLum(lum1,allPix2)==True:
- return True
- return False
- def existEqLum(lum1,allPix2):
- # @lum: Int
- # @allPix2: Pixels's sequence; Seconda immagine
- # @return: Boolean
- for p2 in allPix2:
- lum2 = (getRed(p2)+getGreen(p2)+getBlue(p2))
- if lum1==lum2:
- return True
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement