Closed graeme-winter closed 6 years ago
Solved myself - should have remembered numpy array syntax:
raw.raw_image[:,:] = raw.raw_image + black[0] - dark
Good that you solved it. If dark
is also just a scalar, then you can simply do:
raw.raw_image[:] += black[0] - dark
Dark here is an array of same size as raw_image.
You have a place where things like this could be documented? I am happy to do so...
Currently the place for more tutorial-like examples would be https://github.com/letmaik/rawpy-notebooks. There's no place currently for shorter code snippets. So, if you have a nice use case that involves modifying the raw bayer data, then that could become a Jupyter notebook. Before starting on that, please open an issue in that repo to discuss what it is about and whether it fits.
I have constructed a numpy array of a dark image, from the raw_image values, and want to apply this to the data image before postprocess - however I get:
trying to:
here the += black[0] is to ensure value stays positive as all data are type uint16 i.e. keep standard black value...
Any help much appreciated!