From 4dc2099fa4b586d2338d972dcb9fa20e0db1697a Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Fri, 21 Jul 2023 14:17:11 +0200 Subject: [PATCH] Set linear color space for proper viewing --- src/imageformats/hdr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/imageformats/hdr.cpp b/src/imageformats/hdr.cpp index 14dd32b..136784a 100644 --- a/src/imageformats/hdr.cpp +++ b/src/imageformats/hdr.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -242,6 +243,9 @@ bool HDRHandler::read(QImage *outImage) // qDebug() << "Error loading HDR file."; return false; } + // The images read by Gimp and Photoshop (including those of the tests) are interpreted with linear color space. + // By setting the linear color space, programs that support profiles display HDR files as in GIMP and Photoshop. + img.setColorSpace(QColorSpace(QColorSpace::SRgbLinear)); *outImage = img; return true;