Lossless compressing a raw

Hello everyone,

i’ve just bought a new phone that supports camera2 api, and with opencamera is able to shot raw. It produces DNG files ( already upoladed one to raw.pixls.us/ https://raw.pixls.us/getfile.php/1877/nice/HUAWEI%20-%20DLI-L22%20-%2016bit%20(4:3).dng ) that are really big and uncompressed.

Is there a way to losslessy compress them retaining all data inside and being still able to use them as they are in a raw processor, for example rawtherapee? Are there alternatives to Adobe dng converter (i can use it via wine, but i would prefer not)?

It’s quite a waste of space!

Thank you in advance.

Hey

I would trust Adobe DNG Converter over any other.

One alternative is to use HDRMerge, which creates floating-point compressed DNG files.

To have it process single raw images:

for f in ~/photos/*.dng; do
    hdrmerge -o "/tmp/${f##*/}" --single -b 16 -p half "$f";
done

Down from 26MB to 16MB.

Though I only offer this as a proof of concept, not something I would actually recommend, as RawTherapee, darktable and Adobe Lightroom are the only programs I know of which handle floating-point DNG files.

1 Like

If you just want this for archiving, you can put the file(s) into an simple archive. With your example an .tar.xz is ~ 10 MB in size without changing a bit.

1 Like

Thank you, i’ve tried with dng converter and it goes down to 10.5 mb, i think i’ll use it.