Closed DuncanM-XR closed 10 months ago
Which rawpy version are you using? What's the libraw version in darktable?
I was using Darktable version 4.2.1 so LibRaw 0.21.1.
For the python code snippet, I've run that on rawpy 0.16.0 (current one used in my project), 0.17.3 and 0.18.1, all producing the same result.
The libraw version is 0.21.1 with 0.18.1, so it shouldn't be that. Can you share a sample file?
I've a put a raf
in this google drive folder, gives me this when run with the code snippet on those versions:
This is a white balance issue. See the parameters you can use here: https://letmaik.github.io/rawpy/api/rawpy.Params.html
In your case, simply using the white balance correction stored by the camera does the trick:
rgb = raw.postprocess(use_camera_wb=True)
The WB is not the issue, the blackbar is. If I rerun the above code with the use_camera_wb=True
I still get the black bar:
Apologies, you're right of course. What's interesting is that the visible area is already smaller than the full area:
print(raw.raw_image.shape)
# (5196, 7872)
print(raw.raw_image_visible.shape)
# (5184, 7752)
My first thought was that this would be the same. For some reason, libraw doesn't determine the dimensions of the visible area properly leading to the extra black bar.
Running exiftool on the RAW file gives this:
Raw Image Full Size : 7872x5196
Raw Image Crop Top Left : 21 12
Raw Image Cropped Size : 7728x5152
Raw Image Width : 7752
Raw Image Height : 5184
libraw's visible size matches Raw Image Width
/Raw Image Height
but not Raw Image Cropped Size
. I'm not fully sure why there are three sizes, but it must be related to that.
It would be good to check if you can get the right crop using dcraw.
@kmilos Do you have any idea what's going on here? I'm not that familiar with darktable but I saw it uses both libraw and rawspeed, could that explain the difference in crop behavior? When is darktable using which library?
darktable doesn't use LibRaw for Fujifilm raws, but RawSpeed. There, the crop for X-H2 is defined as 120 from the right (and 12 each from top/bottom).
LibRaw is used by dt only for Canon CR3s, as that codec is not implemented yet by RawSpeed.
Thanks @kmilos.
@DuncanM-XR It looks like it's a bug in libraw, can you report the issue there and post the link to it here for tracking?
Looks like the people at libraw seem to think it is just because the X-H2 is only partially supported right now and not full supoorted. Gonna close this issue.
Think this could just be an issue with libraw versioning, but not sure.
When processing some RAW files from the relatively new X-H2 I get a black bar on the far right.
Code for generating:
Originally I assumed this was a problem with libraw as I had the same problem in darktable. But after upgrading to darktable (and therefore a more up to date version of libraw) the problem went away.
I think I may be missing something with where to confirm the support.