Advertisement
davide1409

BGR

Nov 12th, 2019
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. def BGR(pict,k):
  2. #@param pict: Picture
  3. #@param k: int
  4.   for i in range(min(k,getWidth(pict))): # calcolo il minimo, perche' l'utilizzatore della funzione potrebbe mettere un k > della larghezza dell'immagine
  5.     for j in range(getHeight(pict)):
  6.       px = getPixel(pict,i,j)
  7.       new_color = makeColor(getBlue(px),getGreen(px),getRed(px))
  8.       setColor(px,new_color)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement