nothinglo/Deep-Photo-Enhancer

Export Your Images to SRGB

JeremyAlain opened this issue · 12 comments

Okay so it took me another few hours to figure that one out. I know that in a previous issue #38 we talked about exporting your images from Lightroom in ProPhotoRGB. This comes from the fact that the on the website of the Adobe 5K dataset (https://data.csail.mit.edu/graphics/fivek/) they say that they provide the images in ProPhotoRGB format.

BUT...when I use pro photo RGB my images look like this:
bildschirmfoto 2018-12-27 um 21 47 52

And the original label looks like this:
bildschirmfoto 2018-12-27 um 21 48 33

So after training the supervised model I get a very nice PSNR, but unfortunately the images look very strange...So even though Adobe says they use ProPhotoRGB images, in my case this does not work. I don't know if this is general or if this is specific to my case(as another user from #38 says he uses ProPhotoRGB). After googling around one also finds that sRGB is a format which makes the image independent of the screen...so that doesn't sound too bad an intuition why one should use it. Maybe try both.

Oh and what I mean my images look like this is...
i do
image = cv2.imread(myimage, -1)
cv2.imwrit('foolocation', image)

So this is not somehow the output of the model....really just importing and exporting the image makes it look strange.

So have you trained with sRGB photos? What's the output looks like?

Okay so I dont have time to really do a perfect comparison, but I think these images should illustrate what I mean(althought they are not from the same epoch)
here is the ProphotoRGb output(after 27 epochs):
bildschirmfoto 2018-12-29 um 11 32 52

then here we have the srgb output (after 13.5 epochs):
bildschirmfoto 2018-12-29 um 11 33 05

and here we have the original
bildschirmfoto 2018-12-29 um 11 33 11

One can already see that the srgb output has the same bluish tones as the original.

ALSO VERY IMPORTANT:
with the srgb I am finally able to perfectly match the results that they report in the paper for the supervised learning. I get a PSNR of 23.74(they report 23.8)
With the proPhotoRGB I got a PSNR of 25.x (I dont remember exactly anymore)...so that indicates that they were not using this dataset.

@JeremyAlain Thanks a lot for your reply. I will add this to the README. Thanks again.

Thanks for your post, maybe I should export them to sRGB and train from scratch. @JeremyAlain

qq 20190102110752
Ground Truth / sRGB / ProPhotoRGB epoch: 89
Yeah, the sRGB result is more realistic.

Okay so it took me another few hours to figure that one out. I know that in a previous issue #38 we talked about exporting your images from Lightroom in ProPhotoRGB. This comes from the fact that the on the website of the Adobe 5K dataset (https://data.csail.mit.edu/graphics/fivek/) they say that they provide the images in ProPhotoRGB format.

BUT...when I use pro photo RGB my images look like this:
bildschirmfoto 2018-12-27 um 21 47 52

And the original label looks like this:
bildschirmfoto 2018-12-27 um 21 48 33

So after training the supervised model I get a very nice PSNR, but unfortunately the images look very strange...So even though Adobe says they use ProPhotoRGB images, in my case this does not work. I don't know if this is general or if this is specific to my case(as another user from #38 says he uses ProPhotoRGB). After googling around one also finds that sRGB is a format which makes the image independent of the screen...so that doesn't sound too bad an intuition why one should use it. Maybe try both.

Hi, this is because your monitor actually explain the images in ProPhoto color space using the sRGB cotor space. The difference between them can be found here (https://en.wikipedia.org/wiki/Gamut). You need to convert the color space from ProPhoto to sRGB to view the image correctly.

Thanks a lot for the clarification. I was wrong then. @nothinglo, maybe change the Readme again

@JeremyAlain could you provide archive with right "original" and "expert C" images?

Could you please tell me how to convert the image from ProPhoto RGB to sRGB color space ?

@HuiZeng

Could you please tell me how to convert the image from ProPhoto RGB to sRGB color space ?

@HuiZeng

This can be achieved by first convert ProPhoto RGB to CIE XYZ then convert the CIE XYZ to sRGB. The conversion matrix can be found here http://brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html.

Thanks for your advice. I choose to export as sRGB from Lightroom directly. @HuiZeng