def blend_image(img, bgcolor=u'#ffffff'):
 canvas = QImage(img.size(), QImage.Format_RGB32)
 canvas.fill(QColor(bgcolor))
 overlay_image(img, canvas)
 return canvas

def blend_image ( img , bgcolor = u'#ffffff' ) : canvas = QImage ( img . size ( ) , QImage . Format_RGB32 ) canvas . fill ( QColor ( bgcolor ) ) overlay_image ( img , canvas ) return canvas
used to convert images that have semi-transparent pixels to opaque by blending with the specified color .