Advertisement
MaxDvc

InvertRedBlue

Nov 6th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. def invertRedBlue(pict,k):
  2. #@param:
  3. #   pict: picture;
  4. #   k: int;
  5.     height = getHeight(pict)
  6.     width = getWidth(pict)
  7.     for x in range(0,width):
  8.         if x<k:
  9.             for y in range(0,height):
  10.                 pix = getPixel(pict,x,y)
  11.                 r = getRed(pix)
  12.                 b = getBlue(pix)
  13.                 setRed(pix,b)
  14.                 setBlue(pix,r)
  15.     return(pict)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement