There are several ways to construct a Qt variant of class qt.QImage.

Returns a new image of width w and height h. The image is bitonal when the optional boolean flag monoflag is true. Otherwise the image is a 32 bits RGBA image.

Returns a new image obtained by reading the image file f. Argument f can be a file name or a Lua file descriptor. The file format is determined by the optional string format or by the file name extension.