Changing Faces Colors in UV

Am trying to change the color of a selected face in the UV image window(from a python script). Is it possible to change the color of all the pixels belonging to one face(after unwrapping) in the UV window without manually doing image.setPixelF() for each pixel???

Any help is appreciated, thanks in advance.