So it's probably not 24b. In that case the image uses a colour table - setPixel only determines which index of the colour table describes the colour of the image. The actual colour needs to be placed into the colour table. See QImage docs for details.