You always need to set pixel data according to the format you specified while creating/loading the image. If you want to set the pixel value in the alpha premultiplied format, you need to multiply each of the RGB components by the alpha value (ranging from 0.0 to 1.0). So the correct calculation is color.red()*color.alpha()/255.0
Bookmarks