Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.81k stars 316 forks source link

Fujifilm GFX100II Image with RawTherapee does not render correctly when opened #7000

Closed CaptainMorgan12 closed 6 months ago

CaptainMorgan12 commented 7 months ago

Describe the bug

  1. open image in rawtherapee
  2. observe image black and not rendered (thumbnail on the left is what it looked like prior to trying to open it when it turns black including the thumbnail and image)

Screenshot from 2024-03-18 13-26-55

gThumb can open the .RAF image though incorrectly rotated, DarkTable has also trouble opening the image. Also please note that RawTherapee works just fine with uncompressed .RAF files generated with Fujifilm GFX50s camera.

Same result for flatpak or ubuntu .deb install with image rendering black. Also when opening several images quickly switching between app crashes.

Steps to reproduce

Image: RAW, Uncompressed, Output Depth (bit) 16bit, Auto White Balance "White Priority", Color Space sRGB, Adjust image settings for Clarity +2, Dynamic Range 400, Sharpness +2, Smooth Skin Effect Weak, Color Chrome Effect Weak, Image Size 4:3. Image Width 11808 Image Height 8754 Strip Offset 2048 Strip Byte Counts 206734464 WB GRB Levels Standard 302 341 907 17 302 581 530 21 WB GRB Levels Auto 302 489 648 WG GRB Levels 302 489 648

See above

Expected behavior

should open image so i can edit the RAW image file

Logfile | Screenshot | Screencast

Options: Verbose=true, run flatpak from terminal:

CacheImageData::load / Error code 4 while reading values from "/home/amiga/.var/app/com.rawtherapee.RawTherapee/cache/RawTherapee/data/DSCF0088.RAF.1b7df7ec53066f06c126f8e00f66ccf3.txt": No such file or directory minQ=0.000105 maxQ=0.000105 Qpro=243.935028 minQ=0.000105 maxQ=0.000105 Qpro=243.331268 minQ=0.000105 maxQ=0.000105 Qpro=243.321060 minQ=0.000105 maxQ=0.000105 Qpro=215.200211 LENSFUN: camera: --- lens: --- correction: NONE minQ=0.000105 maxQ=0.000105 Qpro=239.660919 minQ=0.000105 maxQ=0.000105 Qpro=434.143646 minQ=0.000105 maxQ=0.000105 Qpro=227.757156 minQ=0.000105 maxQ=0.000105 Qpro=236.175842 minQ=0.000105 maxQ=0.000105 Qpro=243.935028 minQ=0.000105 maxQ=0.000105 Qpro=243.321060 minQ=0.000105 maxQ=0.000105 Qpro=243.331268 minQ=0.000105 maxQ=0.000105 Qpro=215.200211 minQ=0.000105 maxQ=0.000105 Qpro=434.143646 minQ=0.000105 maxQ=0.000105 Qpro=227.757156 Loading Fujifilm GFX100 II image from /media/Drive/_DSF0084.RAF... no constants in camconst.json exists for "Fujifilm GFX100 II" (relying only on dcraw defaults) raw dimensions: 11808 x 8754 black levels: R:0 G1:0 B:0 G2:0 (provided by dcraw) white levels: R:65535 G1:65535 B:65535 G2:65535 (provided by dcraw) raw crop: 72 2 11664 8750 (provided by dcraw) color matrix provided by dcraw cam_mul:[518.000000 302.000000 613.000000 0.000000], AsShotNeutral:[0.583012 1.000000 0.492659 0.000000] pre_mul:[0.845024 0.492659 1.000000 0.492659], scale_mul:[0.901360 0.525504 1.066668 0.525504], cblack:[4096.000000 4096.000000 4096.000000 4096.000000] rgb_cam:[ [ 1.000000 0.000000 0.000000], [0.000000 1.000000 0.000000], [0.000000 0.000000 1.000000] ] Raw As Shot White balance: temp 5885.089874, tint 0.546726 Warning: Directory Fujifilm has an unexpected next pointer; ignored. Load /media/Drive_DSF0084.RAF: 4779612 usec cam_mul:[518.000000 302.000000 613.000000 0.000000], AsShotNeutral:[0.583012 1.000000 0.492659 0.000000] pre_mul:[1.000000 1.000000 1.000000 1.000000], scale_mul:[1.066668 1.066668 1.066668 1.000000], cblack:[4096.000000 4096.000000 4096.000000 0.000000] rgb_cam:[ [ 1.000000 0.000000 0.000000], [0.000000 1.000000 0.000000], [0.000000 0.000000 1.000000] ] Raw Reference white balance: temp 6501.903534, tint 0.999991, multipliers [1.000000 1.000000 1.000000 | 1.000000 1.000000 1.000000] Fujifilm GFX100 II FF0126227242 59353730363223091406302011101E.badpixels not found Fujifilm GFX100 II.badpixels not found Preprocessing: 596926 usec Demosaic Bayer image n.1 using method: amaze Demosaicing Bayer data: amaze - 1405079 usec automethod=Camera Applying white balance, color correction & sRBG conversion... Applying Highlight Recovery: Inpaint opposed Can't load DCP profile '(cameraICC)'! minQ=0.000105 maxQ=0.000105 Qpro=227.757156 Can't load DCP profile '(cameraICC)'! minQ=0.000105 maxQ=0.000105 Qpro=227.757156 minQ=0.000105 maxQ=0.000105 Qpro=227.757156 Can't load DCP profile '(cameraICC)'! minQ=0.000105 maxQ=0.000105 Qpro=227.757156

Original Image Download Here: https://ln5.sync.com/dl/b9031a130/j226dk2f-nugswk6z-5hdeh8kb-e39bs4sn

......

RawTherapee version

RawTherapee .deb install Ubuntu 5.9, or RawTherapee Flatpak install 5.10

What OS are you using?

Linux

What is the version of your OS?

Ubuntu 23.10

Describe your system?

Wayland, AMDGPU, MacPro 2013 Apple Inc. MacPro6,1, Intel® Xeon® E5-1620 v2 × 8, Kernel Linux 6.8.0-060800-generic, AMD Radeon™ HD 7800 Series, Intel® Xeon® E5-1620 v2 × 8, Fujifilm GFX100II

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

kmilos commented 6 months ago

DarkTable has also trouble opening the image.

Note that darktable has no problem opening uncompressed and lossless GFX100 II raws, and this seems something specific to your setup (or flatpak).

CaptainMorgan12 commented 6 months ago

Darktable only works with the RAW file with OpenCL enabled, with it enabled it shows with OpenCL disabled it does not. For RawTherapee it still does not open as indicated above, so not sure if RawTherapee uses OpenCL, or can be configured to enable it. According to https://github.com/Beep6581/RawTherapee/issues/3385 it does not support it.

kmilos commented 6 months ago

Darktable only works with the RAW file with OpenCL enabled, with it enabled it shows with OpenCL disabled it does not.

darktable works for me for these files on Windows w/o OpenCL (integrated Intel graphics not supported).

CaptainMorgan12 commented 6 months ago

Good to know, it could be linux system related however the Fujifilm GFX50s RAF RAW uncompressed images load correctly on my current system. That makes me believe it is more of a configuration issue with the app themselves, maybe the missing camera profile etc.... I could try to build RawTherapee from source and see if that can fix it..., built from source 5.9 but no cigar same black rendering.

kmilos commented 6 months ago

There's probably code changes to do along the lines of https://github.com/Beep6581/RawTherapee/pull/6208

CaptainMorgan12 commented 6 months ago

Good find, maybe there is a section for /rtengine/fujiuncompressed.cc that needs revising to add 16bit option. Alternatively, let me try to shoot uncompressed with 14bit and see if that actually works right now. Bingo RawTherapee 5.9 (compiled from source) works opening the 14bit uncompressed RAW RAF image.

diff --git a/rtengine/fujicompressed.cc b/rtengine/fujicompressed.cc
index 45622eb7f..f747b1fbe 100644
--- a/rtengine/fujicompressed.cc
+++ b/rtengine/fujicompressed.cc
@@ -25,7 +25,7 @@ int bitDiff (int value1, int value2)
     int decBits = 0;

     if ( value2 < value1 )
-        while (decBits <= 12 && (value2 << ++decBits) < value1)
+        while (decBits <= 14 && (value2 << ++decBits) < value1)
             ;

     return decBits;
@@ -42,7 +42,7 @@ void CLASS init_fuji_compr (struct fuji_compressed_params* info)
         derror();
     }
sgotti commented 6 months ago

A just two minutes work wip PR: #7002. More tests are needed, check if the sensor is really the same, check crop, matrix etc....

kmilos commented 6 months ago

check if the sensor is really the same

It is not, the GFX100 II sensor is refreshed from 100/100S, so the matrix is different. 😉