Beep6581 / RawTherapee

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

RAW histogram #628

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 639

This is a feature suggestion

It would be nice if it was possible to display a RAW histogram in addition to the processed
histogram that RT displays now (you don't need to show both at once, by clicking on
the histogram or something to toggle)

A RAW histogram shows the actual content of the RAW RGB channels. This way you can
exactly see how well the photo is exposed. Of course you can't do much about the RGB
filters in the camera sensor (unless you get really funky with color filters on the
lens) but as a "perfectionist" you're really curious about knowing exactly how the
file is exposed which currently is not so easy to find out.

As a sidenote - the lack of RAW histograms is also a favorite complaint about histograms
in Canon and Nikon cameras (they show histograms on the JPEG preview), if I'm correctly
informed only Leica currently has RAW histograms in-camera.

It is said that the Canon DPP software can show RAW histograms (haven't verified this
myself).

Reported by torger@ludd.ltu.se on 2011-04-18 10:36:35

Beep6581 commented 9 years ago

Reported by oduis@hotmail.com on 2011-04-18 16:29:56

Beep6581 commented 9 years ago
From what I gather, the raw histogram is visible as the background to the tone curves.
Naturally it would be better to be able to switch the main histogram to show it, and
to select which raw channel to plot it from.

Reported by entertheyoni on 2011-04-18 20:01:44

Beep6581 commented 9 years ago
The background to the tone curves is the L channel of Lab derived from the working space
data, not the raw histogram.

Reported by ejm.60657 on 2011-04-18 22:23:56

Beep6581 commented 9 years ago
I also missed a RAW histogram to check what it looks like on camera level, and if I
exposed correctly.
Patch is attached. You now have a new "Raw" button at the main histogram to switch
between normal and RAW view.
The RAW histogram is calculated right before demosaicing, so taking e.g. Raw Whitepoint
into account. Since there is no luma for obvious reasons that histogram is disabled
there. For practical reasons a standard gamma is applied to the channels.

Reported by oduis@hotmail.com on 2011-04-23 14:42:49


Beep6581 commented 9 years ago
Hi Olli, patch works great, this is very useful feature. 
A couple observations:
1. When crop is enabled, raw histogram is reflecting full image, not the cropped area.

2. histogrampanel.cc, line 84:

    lhist(256); lhistRaw(256);
    rhist(256); rhistRaw(256);
    ghist(256); ghistRaw(256);
    bhist(256);

is lhistRaw needed and is "bhistRaw(256);" missing here on line 90?

Reported by michaelezra000 on 2011-04-24 02:49:08

Beep6581 commented 9 years ago
Thanks for testing, Michael!

1. I think it's better this way, since you cannot precisely map to pixel level anyway.
During demosaic the colors of one pixel are interpolated from the surrounding pixel
of the bayer pattern, so there is non 1:1 pixel mapping to you RGB crop area.

2. Well spotted Michael! Actually I'll remove that part completely, since the inits
are not needed at all, they are filled by external updates. I think they were just
needed in pre-LUT-class times.

Before I supply an updated patch I'll discuss one issues with Emil. I requested a quick
review, and he spotted some possible unpreciseness regarding white balance.

Reported by oduis@hotmail.com on 2011-04-24 09:37:47

Beep6581 commented 9 years ago
Here is an updated versions. It also includes feedback from Emil: the RAW is now calculated
at a stage directly coming from the sensor (just basic correction, not white balance
etc.), so earlier. That allows you to better judge if you've leveraged the full dynamic
range of the sensor at shooting time perfectly. Downside is that you do not see the
effects like e.g. raw white point (that are later in the pipeline).

Little addition: Raw White point now does not update if you just move preservation
while correction is 1.0. Handy if you want to set the two params without an unnecessary
long demosaic step.

Reported by oduis@hotmail.com on 2011-04-24 17:29:34


Beep6581 commented 9 years ago
This patch calculates the RAW histogram without resetting the raw white point or applying
white balance.  RawHist3.patch did not quite accomplish that.

Reported by ejm.60657 on 2011-04-25 02:13:47


Beep6581 commented 9 years ago
Thanks for the bugfix! Committed to DEFLOAT.

Reported by oduis@hotmail.com on 2011-04-25 08:22:14