QPixmap pixmap("image.png"); pixmap.save("saved_image.png", "PNG");
QPixmap pixmap("image.jpg"); pixmap.save("saved_image.jpg", "JPEG", 80);This example loads an image from the file "image.jpg" and then saves it to "saved_image.jpg" as a JPEG file with 80% compression. Package library: Qt.