3 ms·
Great notebooks! While looking at the "cornell_box_pt_numpy.ipynb" one I noticed a few things odd: - The input colours to the walls are scaled by somehow arbit
by kelsolaar 7y ago
Great notebooks! While looking at the "cornell_box_pt_numpy.ipynb" one I noticed a few things odd:
- The input colours to the walls are scaled by somehow arbitrary values and they don't seem to match the spectral reflectance distributions converted to, for example, sRGB:
White
-----
Jupyter Notebook : [255, 239, 196] / 255
sRGB (Scene-Referred Linear) : [ 0.73825082 0.73601591 0.73883266]
sRGB (Output-Referred) : [ 0.87468844 0.87351472 0.87499367]
Green
-----
Jupyter Notebook : [.117, .4125, .115] * 1.5
sRGB (Scene-Referred Linear) : [ 0.06816358 0.39867395 0.08645648]
sRGB (Output-Referred) : [ 0.28953442 0.66418933 0.32540958]
Red
---
Jupyter Notebook : [.611, .0555, .062] * 1.5
sRGB (Scene-Referred Linear) : [ 0.49389675 0.04880702 0.05120209]
sRGB (Output-Referred) : [ 0.73132279 0.24476901 0.2508128 ]
The correct values, assuming a sRGB working space, would be the middle rows, i.e. sRGB (Scene-Referred Linear).
- The final image does not seem to be encoded for Output/Display, i.e. there is no gamma correction thus it is not displayed correctly.
- ericjang 7y agoThanks, you are correct :) I chose the spectral reflectance distributions by tuning the values manually until it looked correct. And yes, I didn't do gamma correction (I deliberately ignored photometry related conversions) so that could explain why my tuning resulted in odd values.
- kelsolaar 7y agoWould be very easy to fix using the above numbers and adding proper encoding, even a naive gamma 2.2 would help :) Here is a Gist for the spectral computations: https://gist.github.com/KelSolaar/fb1e09b56b54d37d90e1886aef5ea4d4 https://gist.github.com/KelSolaar/fb1e09b56b54d37d90e1886aef... (It uses Colour: https://github.com/colour-science/colour https://github.com/colour-science/colour)