I am converting a RGB image to EXR format, using openexr, as follows:
int w = 1024;
int h = 768;
Array2D<Rgba> p (h, w);
QString fileName = "Penguins.jpg";
QImage Image = QImage(fileName);
QRgb c;
for (int y = 0; y < h; ++y)
{
for (int x = 0; x < w; ++x)
{
c = Image.pixel(x,y);
Rgba &p = px[y][x];
p.r = qRed(c)/255.0;
p.g = qGreen(c)/255.0;
p.b = qBlue(c)/255.0;
p.a = 1;
}
}
However, the converted image has different color, compare to the result of the graphics editor software, such as Adobe Photoshop. Below, you can see the given image, and the converted one (opened in Adobe Photoshop):