roniemartinez / libqpsd

PSD (Photoshop Document) & PSB (Photoshop Big) Plugin for Qt/C++ (Qt4/Qt5)
GNU Lesser General Public License v2.1
108 stars 25 forks source link

32-bit support #13

Open roniemartinez opened 11 years ago

roniemartinez commented 11 years ago

I am having problem converting 32-bit depth into 8-bit depth. It seems that I can get the image's "silhouette" using the formula value_8bit = value_32bit * (qPow (2, 8) - 1) / (qPow(2, 32) - 1)

But if I multiply it again with (qPow (2,8) -1) or 255, the image is almost close, at least at "grayscale" mode. I can't find any references on the conversion.

roniemartinez commented 11 years ago

Unfortunately, I was wrong. Just found out that 32-bit depth psd is HDRI and needs "tone mapping". I can't find any "lightweight' library.