Closed thomaskleiven closed 1 year ago
rawpy (LibRaw that is) and RawTherapee might be providing you with different crops of the raw array in the file, so "first pixel" is a relative term here. Does raw_image_visible
perhaps correspond better?
Run e.g. exiftool -a -u -s -g1
on your DNG file and see the many tags related to image size, active area, and crops. Different libraries might interpret the crops differently.
Another thing: LibRaw/rawpy should show you the real raw pixel value in raw_image
/raw_image_visible
. Don't know what RT shows in that screenshot? Does it include black level or not (seems it is already removed in the histogram)? Any stretching/scaling to white point? "57" out of what, 255 or 65535?
In any case, I don't see any issues here w/ rawpy. Perhaps you might want to close this and move it over to discussions.
Thanks for the pointers. Didn't manage to get exactly the same histograms pr channel using rawpy
(LibRaw) vs. RT, but as you mention, this is probably not an issue with rawpy
as RT might do some additional cropping, etc. Happy to move the issue to discussions.
Is it possible to split the raw data up into its red, green, and blue components before demosaicing?
It seems like that raw data is available using
raw_image
(docs)Provided that the sensor data is on the format RGGB, then
img[0,0]
would correspond to the first red pixel of the sensor data.Goal: Extract the value of the first red pixel
Method 1) Using
rawpy
, the value ofimg[0,0]
is158
.Method 2) Using
RawTherapee
(docs) to read the same image, it suggests that the first red pixel (before demosaicing) is 57 as seen below.Example RAW image:
sample1.dng
found (here: google drive)I'm probably missing some basic logic here, but is it possible to obtain the same value using
rawpy
? Thanks in advance for any pointers.