Credible repair of "raw" images with KREMY
Sep 27, 2021
5
Over the years, I've done a bunch of things to "credibly repair" defects in raw images. I know that raw files are supposed to be unprocessed, but that ship sailed long ago for many cameras... and Adobe DNGs are nearly always cooked.
Anyway, back in 2017 I published Refining raw pixel values using a value error model to drive texture synthesis -- the presentation slides are here . KREMY (KentuckY Raw Error Modeler, pronounced "creamy") was the software I wrote to implement that. The problem is that the C code implementing that used a combination of dcraw and Adobe DNG Converter (ADC) . Unfortunately, dcraw stopped being maintained in 2018, and ADC mutated and also is no longer easily run in a Linux environment. That combo meant that within a year, KREMY's code wasn't very useful.
Well, last week I was very pleased to stumbled upon raw2dng , which uses libraw to read raw files and then outputs a DNG -- everything I needed to re-implemented KREMY!
It took less than a day to hack raw2dng to incorporate the original KREMY algorithms, which basically compute a pixel value error model and then use constrained texture synthesis to tweak raw pixel values within their error-value-bounds. Of course, I then made the mistake of looking at my old code and re-thinking how it build the error model and even how it does the texture synthesis. So, I've now got a significantly heavier-handed version that I'm playing with. The question is, am I overdoing it?
For example, here's a JPEG from DSC00315.ARW , the DPReview ISO 25600 test scene shot by a Sony a7C, and processed by standard raw2dng and rawtherapee with "neutral" settings:
JPEG using rawtherapee to neutrally process a DNG from raw2dng
And here's my newly much more aggressive version of KREMY built using that same toolchain:
JPEG using rawtherapee to neutrally process a DNG using KREMY-augmented raw2dng
Have I gone too far with this?
My plan is to post a version of KREMY as an open-source mod to raw2dng, and probably also to make a web-browser-interface version freely available at my web site.