1. Brendan Howell
  2. PyCessing

Source

PyCessing / pycessing / data / examples / image-transforms.cess

# image transformations
img = Image("image.jpg")

delta = 50
direction = 1

def draw():
    global delta
    global direction

    setBackground(0,0,0)
    
    #scale to x, y pixels
    img.scale(delta, delta)
    
    #rotate in degrees
    img.rotate(delta)
    
    #flip along x,y or both axes
    #img.flip()
    
    img.draw(150, 100, 50, 50)
    
    circle(150, 100, 3)
    
    delta += direction
    
    if (delta > 360) or (delta < 1):
       direction = direction * -1