Using RawTherapee as a Library

I’d like to be able to access RawTherapee’s powerful RAW image analysis and manipulation programatically, on timelapse images - for example to de-flicker, exposure adjust, and crop ~1000 images. It wouldn’t be sufficient a single profile to all of the images, as for example a de-flicker requires analysis of the images around it in time.

I think RawTherapee does most of it’s own analysis and manipulation, not relying on many external libraries. Is that correct? Has anyone already done the work to compile it as a library, and wrap it in a scripting language? Does my approach sense-check, or am I barking up the wrong tree entirely?

It may not have everything from RT you’d want to use, but all the basic good stuff is there.

Thank you - appears to be a move in the direction I’m looking for, but little there as yet, only de-mosaicing. I’m curious about the approach, and why they’ve decided to go file-by-file instead of a wholesale build of the RT engine.

There’s also highlight reconstructin and chromatic abberation correction.

I’m not a RT code base expert, but it may be that the “engine” would be a bit hard to tease out from under the UI. Me, I was thrilled with what they did, as I was trying to figure out how to get at least one decent demosaic in my hack software, and it just showed up at precisely the right time… Thanks, @carvac and @heckflosse !!

1 Like

Looks like something I need to dig into a bit, and learn more. It’s already very helpful to know that someone is building a library, that it’s not a crazy idea and there’ss a need for it.

Both rawproc (my software) and filmulator use it. I’ve seen others inquire/ask questions about it, but don’t know if it got traction.

A lot of softwares have gouged out routines from dcraw, including Adobe early on. Good algorithms, but the code sometimes looks like assembler…

Including RT - much of it is currently using a hacked-up semi-librarified variant of dcraw.

Not wanting to FORC3 myself to deal with dcraw’s odd loop macros in the code is one of the main reasons I’m keen on taking a crack at replacing dcraw with libraw after RT 5.9 is released. :slight_smile:

1 Like

Yup. I choose my hobbies carefully, and alas, decoding raw files wasn’t destined to become one of them. In rawproc, I got CR3 decoding as they came up with it, no drama. Based on informal dialogue here and there, I get the impression that not all are enamored with some aspect libraw; bear-of-little-brain here just sees that it works.

I have mixed feelings about it myself - it seems like a lot of development happens behind closed doors, only for a massive pile of work to suddenly get formally released. It’s similar to Android in that regard. But it’s definitely a step forwards compared to the current state of dcraw.