Why same images have different brightness in QtWidgets app and standard Preview app?
-
I wrote some code that show two widgets:
#include <QtWidgets/QApplication> #include <QtWidgets/QLabel> #include <QtGui/QPixmap> #include <QtWidgets/QWidget> #include <QtGui/QPalette> #include <QtGui/QPixmap> #include <QtGui/QBrush> int main(int argc, char** argv) { QApplication app(argc, argv); QPixmap pix; pix.load(":/mira.jpg"); QLabel lbl; lbl.resize(pix.size()); lbl.setPixmap(pix); lbl.show(); QWidget wgt; QPixmap pix2; pix2.load(":/mira.jpg"); QPalette pal; pal.setBrush(wgt.backgroundRole(), pix); wgt.setPalette(pal); wgt.setAutoFillBackground(true); wgt.resize(pix2.size()); wgt.show(); return app.exec(); }
But I noticed that brightness of the image displayed by this widgets and brightness of the same image displayed by standard macOs Preview.app is slightly differ:
It's not an illusion, I checked it with macOS tool DigitalColorimetor.app and brightness is realy differ, thats true!Why same images have different brightness in QtWidgets app and standard Preview app? Which image representation is true?
UPD: I hope that anyone who understands this will be interested in and check that the decoding of jpg images by the Qt library is correct. By the way, Google Chrome displays photos with the same brightness as Preview, and it does not matter which application is in the input focus.
Obviously Qt does something wrong
UPD: image opened in (left to right) Preview.app, Qt Creator (Resource View), Google Chrome