New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
14-bit image has higher pixel values than 14-bit (with no_auto_scale=True) #101
Comments
White balance is applied, with 1.0 for green, red/blue then have >1.0 |
I've tried setting user_wb=[1,1,1,1] but the max is still the same, I think theres some other postprocessing step I haven't considered yet. However if I do rawImg.raw_image.max() , I get 16316 which is about right |
You might also want to try Also, don't forget the black level is subtracted first, and for your camera it seems you want to check against But in any case, there seems to be something not so intuitive going on w/ |
After cross-checking w/ dcraw, I found this clue in the output: "Scaling with darkness 2047, saturation 13584" which means the values will be scaled to 0-65535 range by factor of 65535/(13584-2047) and that's why you saw a higher number than expected. 2047 is of course the black level of your camera model you can also check w/ There is no equivalent of The current workaround I found to preserve the photometric values is to fake the no scaling by e.g. setting @letmaik Maybe this is an argument to expose the white level info alongside the black level so advanced users can check it and manipulate their raw data accordingly? My guess is |
@kmilos I'm happy to expose more metadata as long as it's meaningful. Please open a new issue for this with the required new metadata if you think that's the right way to go. |
Since #102 is merged, is there anything left to do here? It seems there is a way for pro-users to work-around the issue now (after the next rawpy release), and anything else should be a change to LibRaw I assume. I think this trick should be documented though. @jocampo2 Do you think it makes sense to have a jupyter notebook on this in https://github.com/letmaik/rawpy-notebooks ? |
I don't think this problem was significant enough for a whole notebook, maybe a section of a notebook |
Closing this now. There's a new rawpy pre-release that contains the white level data. See the README on how to install pre-releases. |
Hello,
I'm loading a 14-bit .CR2 file and after post processing the image has a max value of 24587. It should have a max of 16384. Do you know why this would be the case?
after this rawImg14.max() = 24587
but with no_auto_scale=False, rawImg14.max() = 65535 it's saturated
there were only 50 pixels with values actually over 2^14
rawpy version is '0.14.0'
python 3.7
Camera used is Canon eos 1100d
ISO 200
shutter speed 30s
Cheers,
Jeremy
The text was updated successfully, but these errors were encountered: