def overlay_image(img, canvas=None, left=0, top=0):
 if (canvas is None):
  canvas = QImage(img.size(), QImage.Format_RGB32)
  canvas.fill(Qt.white)
 (left, top) = (int(left), int(top))
 imageops.overlay(img, canvas, left, top)
 return canvas

def overlay_image ( img , canvas = None , left = 0 , top = 0 ) : if ( canvas is None ) : canvas = QImage ( img . size ( ) , QImage . Format_RGB32 ) canvas . fill ( Qt . white ) ( left , top ) = ( int ( left ) , int ( top ) ) imageops . overlay ( img , canvas , left , top ) return canvas
overlay the img onto the canvas at the specified position .