Support of Sony A7IV lossless compressed raw is missing in RT and ART

RT developers suggested to take a look how to port the code from LibRaw and RawSpeed to RT for this specific camera. While I’m familiar with C++ programming and Linux I have zero experience with such projects. Any concrete suggestions would be appreciated.

Update: ART (RT fork) does support LibRaw if its development version is installed and build system is configured to use it. So now I have at least one RT-style alternative to Darktable for Sony files.

libraw is on the TODO list but it’s a MAJOR effort. Unfortunately RT and ART have diverged enough that it isn’t a simple quick kang.

2 Likes

Does LibRaw support those files? Last time I checked it didn’t, or maybe I remember incorrectly. If it does, it’s probably easier to port from LibRaw than RawSpeed because LibRaw shares a lot of code with dcraw.

@Entropy512 Adding LibRaw to RawTherapee didn’t require much effort. Yes, that’s past tense. I have a pull request on GitHub that is fully functional. I left it as a draft because there is one thing I need to do to improve compatibility when linking to the system LibRaw instead of the internal copy. There’s also a few regressions compared to the internal dcraw (which may affect ART too).

2 Likes

@Lawrence37 Yes, after I enabled LibRaw in ART and rebuilt I was able to load and process lossless compressed files from Sony A7iv.

Oh nice, I’ll have to check out that PR. I think you’ve spent more time in the bowels of the legacy dcraw-based code than I have, I just can’t FORC3 myself to deal with Dave’s macros so I avoid anything remotely near that part…

1 Like

@Lawrence37 I downloaded your repo, selected the libraw-copylib branch, rebuilt RT and was able to load all my lossless uncompressed files from Sony. Great job, now I can play with RT, ART and DT and compare results.

1 Like

@Lawrence37 I processed about 30 lossless compressed files with RT built from your branch libraw-copylib. No issues found. Thanks a lot for the great job! Do you have any plans to merge this functionality into the dev branch of RT?

It’s still semi-experimental. The biggest question is if LibRaw is the way to go, or if we should use another library like RawSpeed. So far, LibRaw looks good.

@Lawrence37 Recently the master branch for RT was updated with many changes including improvements for White balance and Dynamic Range Compression. Is there a way to get these changes in your branch libraw-copylib that I need to use to have support for lossless compressed format in Sony A7IV?

You can merge the LibRaw branch with the dev branch locally and compile. I won’t be making updates to the branch myself until after I’m done with higher priority tasks (e.g. releasing 5.10).

The problem is that libraw-copylib branch is in your own repo only:

$ git status
On branch libraw-copylib
Your branch is up to date with 'origin/libraw-copylib'.

nothing to commit, working tree clean

git remote -v
origin	https://github.com/Lawrence37/RawTherapee.git (fetch)
origin	https://github.com/Lawrence37/RawTherapee.git (push)

The official RT repo does not have your branch:

$ git status
On branch dev
Your branch is up to date with 'origin/dev'.

nothing to commit, working tree clean

$ git remote -v
origin	https://github.com/Beep6581/RawTherapee.git (fetch)
origin	https://github.com/Beep6581/RawTherapee.git (push)

$ git branch -avv | grep libraw

You can add another remote repository, then do the merge. I’m not at my computer and can’t check these commands, but something like this could work on your local copy of the official repository.

git remote add Lawrence37 https://github.com/Lawrence37/RawTherapee.git
git fetch Lawrence37
git merge Lawrence37/libraw-copylib
2 Likes

@Lawrence37 Thanks a lot, worked like a charm!

1 Like

The release version, 5.9, is more than a year old. Is there an ETA for the next release (edit: found an answer elsewhere, estimated end of February), and will support for Sony losslessly compressed RAW files be in it?

Lossless compression will not be supported in 5.10. The task is tracked in various issues like this one: Support for Sony A7R V lossless compressed RAW files · Issue #6726 · Beep6581/RawTherapee · GitHub

Thank you. I’m just about to digitize some 2’ square negatives, and if lossless RAW was going to be supported soon, I could have waited until the next version of rawtherapee to start. But since it will not be supported in the next version, and versions are taking more than a year to come out, I will just have to suffer with uncompressed raw.