ImageQt module

The ImageQt module contains support for creating PyQt6 or PySide6 QImage objects from PIL images.

Added in version 1.1.6.

class PIL.ImageQt.ImageQt(image)

Creates an ImageQt object from a PIL Image object. This class is a subclass of QtGui.QImage, which means that you can pass the resulting objects directly to PyQt6/PySide6 API functions and methods.

This operation is currently supported for mode 1, L, P, RGB, RGBA and I;16 images. To handle other modes, you need to convert the image first.

PIL.ImageQt.toqimage(im)[source]

Creates an ImageQt object from a PIL Image object, or the path to an image.

PIL.ImageQt.toqpixmap(im)[source]

Creates a QtGui.QPixmap object from a PIL Image object, or the path to an image.

PIL.ImageQt.fromqimage(im)[source]

Creates a PIL ImageFile object from a QImage or QPixmap object.

PIL.ImageQt.fromqpixmap(im)[source]

Creates a PIL ImageFile object from a QPixmap object.