Beep6581 / RawTherapee

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

Handling of multiple source files of varying exposure (bracketed, HDR, dual-ISO) #1972

Open Beep6581 opened 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 1988

As it has been pointed out in issue 1944, raw files containing 2 images with different
exposure value can be understood as bracketed image. It would be very nice to extend
support of this file to bracketed images too, to create HDR images.

Here are my proposition on this subject (that also integrate double exposure raw files):

IMMEDIATE GOALS:
----------------

- support double exposure raw file
- support bracketed images of still scene
- checkbox to select between the "enfuse" method (with a tonal compression parameter)
  or the normalized, linear method
- most parameters will be common to all images, but some will be set
  on a per image basis, e.g. :
     - denoising
     - sharpening
- support hierarchical merging, i.e. merging files that contains 2 differently
  exposed sub-images. Each sub image will be merged first before  merging the
  resulting images

FUTURE GOAL:
------------

- support for image alignment
- support for ghost removal (maybe with local editing?)

CAVEATS:
--------

- the technique will use the linear image data, so it will be technically
  restricted to raw files only. We may test with standard images, but I
  don't expect any nice looking image out of this
- will require a lot of memory (as much as if edited separately i guess)
- no batch editing possible from the File Browser, too complex to code and
  rather pointless. Copy/paste may not be allowed either, unless you can give
  me some hint on how to code it.

HOW IT COULD BE DONE:
---------------------

Would it be for a single raw file edition but containing 2 sub-image or for several
bracketed raw image (by selecting several file and selecting the "Edit Bracketed HDR
Image" menu option), the Editor tab would open with an additional "Enfuse" tab (or
whatever it could be more appropriately named), that would display something like this
(worst case example, with e.g. 2 Fuji's RAF files):

[Image #1 = /home/me/My pictures/foo.raf]
    [::subImg 1]
        - linear correction (or exposure comp ???)
        [Denoise parameters]
        [Sharpening parameter]

    - Tone Compression (might be a curve or a threshold widget
      (there one Tone Compression between each image or subimage)

    [::subImg 2]
        - linear correction (or exposure comp ???)
        [Denoise parameters]
        [Sharpening parameter]

- Tone Compression (might be a curve or a threshold widget

[Image #2 = /home/me/My pictures/bar.raf]
    [::subImg 1]
        - linear correction (or exposure comp ???)
        [Denoise parameters]
        [Sharpening parameter]

    - Tone Compression (might be a curve or a threshold widget

    [::subImg 2]
        - linear correction (or exposure comp ???)
        [Denoise parameters]
        [Sharpening parameter]

---------------------------------------------------------------------
Legend:
 [xxx]  : FoldableToolPanel
 -      : Adjuster

Those pp3 files would have a special, double extension, like .HDR.pp3 (or .hpp3 ?)
in order to be detected by the file browser and to generate its own thumbnail. 

Would it be a .HDR.pp3 or a plain .pp3 file, the additional "Enfuse" tab would lead
to an additional section:

[MultiImage.1]  <- ".1" = root level
Filename_1=#2   <- either #x to point to another section, or a real path
ToneCompression_1=0.8
Filename_2=#3
...
(the list could continue)
...

[MultiImage.2]
Filename_1=/home/me/My pictures/foo.raf::1   <- "::1" ask to use the first subimage
ToneCompression_1=1.3
Filename_2=/home/me/My pictures/foo.raf::2

[MultiImage.3]
Filename_1=/home/me/My pictures/foo.raf::1
ToneCompression_1=1.3
Filename_2=/home/me/My pictures/foo.raf::2

[Directional Pyramid Denoising.1.1]  <- .x.y, where x is the section number, y the
file number
Enabled=false
Luma=0
... etc...

Same for the Sharpening tool, and any other one that we want to put entirely in the
"Enfuse" tab.

Regarding the pipeline, the merge would roughly occur after the demosaicing, and before
rgbProc. I didn't investigated all that should be done, but i guess it's doable.

The last remaining problem before beginning coding (if you're okay with this, i'll
wait 1 week for comments), is that the "linear correction" comes from the "Raw / Exposure"
tool, but i don't want (need) to take everything from this tool :-/.

Reported by natureh.510 on 2013-09-25 23:05:42

Beep6581 commented 9 years ago
Hombre, a lot of information you throw here... 

As I often make stitched panoramas with Hugin enblend/enfuse I can say that some of
the points you mention are already solved there (Image alignment, ghost removal...)
 (it's OpenSource, but doesn't support RAW) and maybe we can have a look at the methods
to adopt them for RT.

Ingo

Reported by heckflosse@i-weyrich.de on 2013-09-25 23:21:00

Beep6581 commented 9 years ago
Yes, lots of informations but I'm thinking about it for some time now, and just thought
about a way to do it recently, so i "laid them on paper".

I wouldn't focus on image alignment and ghost removal first, because i think it can
be added later, I'd like to focus on the core of the feature first, but yes, it'll
definitely help.

Reported by natureh.510 on 2013-09-26 20:56:44