Commit Graph

141 Commits

Author SHA1 Message Date
rom9
22eee9787e Film negative stable multipliers (#5485)
* Added new feature to calculate channel multipliers from crop area. This also saves the crop area channel medians to the processing profiles, in order to get a more consistent color balance when batch-applying the same profile to multiple pictures from the same film roll.

* Fixed wrong initialization of array, and missing check for the result of `getFilmNegativeMedians()`.
Moved `ImProcCoordinator::translateCoord()` from private member to anonymous namespace.
Fixed some whitespace and formatting issues.

* Fixed some formatting issues

* Passed `ipf` parameter as const in `translateCoord`.
Narrowed `using namespace` to single class `Coord2D`.

* Added `scaleGain` entry to thumbnail metadata file, to make `scale_mul` multipliers available in thumbnail processing phase. This simplifies multiplier calculations, so that "faking" thumbnail multipliers in the main image processing is not necessary anymore. This way, output values are immune to slight variations of multipliers between successive shots taken with in-camera AWB turned on.
Shifted multipliers so that the output channel medians are balanced when "Camera WB" is selected. This way, just computing multipliers from crop and setting "Camera WB" (which is the default) gives a pretty well balanced image as a starting point.

* New channel scaling method, based on a film base color sample instead of crop area channel medians. Channels are scaled so that the converted film base values are equal to 1/512th of the output range (65k). This giver better black levels in the output, and more consistency when batch-processing multiple negatives.
The output is now compensated for a known fixed WB value, so that the film base will appear grey when WB is set to 3500K, Green=1.
Added PPVERSION 347 to preserve backwards compatibility: when a processing profile saved by RT 5.7 is loaded (PPVERSION=346), the new fields are initialized to the special value -1, which will instruct the main processing to follow the old channel scaling behaviour. The old channel scaling multipliers will then be converted to the new film base values so that the resulting image is the same, and the fields will be overwritten as soon as the PP is saved again. This will transparently upgrade the processing profile.
When the new behaviour is used, but the film base values are still unset, they are estimated based on channel medians, excluding a 20% border around the image. This should give a better result out-of-the-box for pictures containing a large film holder.

* Code cleanup from review

* Run astyle on film neg source files

* Fixed automated build failure caused by incompatible libraries on my dev PC.

* Simplified `Thumbnail::processFilmNegative` method signature. There is no need to pass in `rmi`,`gmi`,`bmi` multipliers from the caller, i can do the same with my own internal multipliers.

* Added `FilmNegListener` class to pass estimeted film base values to the GUI after first processing. Removed old `filmBaseValues` instance variable from RawImageSource.

* Code cleanup

* Forgot to set baseValues flag in `PartialPasteDlg::applyPaste`
Fixed `filmBaseValuesLabel` not updating when reading zero baseValues. Normally not needed (the label is updated later by the listener), but when the user is browsing through pictures the listener won't fire, so the label must be updated to show values are unset.

* Overwritten channel scaling multipliers by calling `get_colorsCoeff` with `forceAutoWB=false`.
Initially, in `RawImageSource::load`, channels are auto-balanced by averaging the whole picture when computing multipliers.
This can give different multipliers for multiple shots of the same camera, which will lead to inconsistent conversions when batch-processing multiple negatives.
This commit re-sets `scale_mul`, `ref_pre_mul`, etc., in order to "undo" the auto-WB and use the normal camera multipliers.

* Found an easier way to get stable overall multipliers, removed the (horrible) on-the-fly mutation of scaling instance variables.
2020-04-13 17:20:56 +02:00
Ingo Weyrich
a9e2bde610 use autold instead of auto, #5676 2020-02-28 11:44:25 +01:00
Ingo Weyrich
67ca8e2c19 further aehistograms cleanup 2020-02-13 16:34:45 +01:00
Ingo Weyrich
b627adea3a Merge branch 'dev' into fix-double-promotion 2020-02-09 16:45:20 +01:00
Ingo Weyrich
8f291c3ff2 Be -Wunused-macros clean 2020-02-07 20:18:35 +01:00
Ingo Weyrich
914daffa39 more double promote fixes, still not complete 2020-01-22 00:11:39 +01:00
Ingo Weyrich
2ce6e6d1d3 skip unnecessary transform 2020-01-02 14:35:27 +01:00
Ingo Weyrich
03c0d6c86c Some cleanups, also fix some fallouts from reduce_include_dependencies branch 2019-11-05 20:31:17 +01:00
Ingo Weyrich
6335b68a80 Further reduction of include dependencies 2019-11-03 14:52:42 +01:00
Ingo Weyrich
cac2eb53ef Further reduction of include dependencies 2019-10-31 20:41:08 +01:00
Ingo Weyrich
6935faa258 Further cleanup of include dependencies 2019-10-30 22:12:06 +01:00
Ingo Weyrich
ba8dda1836 Further cleanup of include dependencies 2019-10-30 16:38:02 +01:00
Flössie
d7ec033829 Reduce dcp.h dependencies 2019-10-30 09:30:21 +01:00
Ingo Weyrich
068847eb5a Further cleanup of include dependencies 2019-10-29 21:06:27 +01:00
Ingo Weyrich
22e5348db7 Forward declare LabImage 2019-10-28 17:17:15 +01:00
Ingo Weyrich
eaf0eeff4e Forward declare CieImage 2019-10-28 15:43:58 +01:00
Morgan Hardwood
60b2196bce Updated gnu.org links to use HTTPS 2019-09-10 12:34:57 +02:00
Ingo Weyrich
11bf7e5eb5 fix broken crop lines in file browser, fixes #5440 2019-09-05 15:16:24 +02:00
Ingo Weyrich
9165d0acb7 Crop area not shown on File Browser window thumbnails, fixes #5440 2019-09-05 12:08:36 +02:00
Hombre
ce04447c7a Fix crash while rotating several thumbnails in File Browser
Fix issue #4858 and possibly #5310
2019-09-03 22:18:20 +02:00
Ingo Weyrich
5ea18efeb8 RT crashes on loading Hasselblad H6D-100cMS pixelshift files, fixes #5433 2019-09-01 20:22:42 +02:00
rom9
85aacaddf2 Minor whitespace fix 2019-07-17 00:53:36 +02:00
rom9
41e5899f97 Moved film negative thumbnail processing to own compilation unit 2019-06-28 22:54:32 +02:00
rom9
938fc63dd0 Replaced powf calls with the optimized pow_F macro (which also works for the non-SSE2 case). 2019-06-27 23:01:51 +02:00
rom9
a3004bb2b8 Added SSE2 optimization in film negative thumbnail processing. 2019-06-27 22:03:59 +02:00
rom9
880a6e125e Added film negative processing in thumbnails, with correct white balance. Calculated channel averages to restore the same initial conditions as RawImageSource, where get_colorsCoeff is called with forceAutoWB = true. Code still needs refinement and cleanup. 2019-06-21 07:12:42 +02:00
heckflosse
3b19b9f55b Rawtherapee 5.6 crashes with.dng from PixelShift2DNG-0.9.8.67, fixes #5348 2019-06-07 16:37:59 +02:00
Flössie
0cbc4923bc Relax dependency from procparams.h 2019-02-28 20:44:50 +01:00
Alberto Griggio
fddb0ec50d fix black thumnbail issue for float DNGs 2018-11-22 15:25:57 +01:00
Alberto Griggio
655bdfd7e7 merged branch 'floatdng' 2018-11-22 08:50:35 +01:00
heckflosse
a19f3484dd Fix some warnings 2018-11-20 20:32:36 +01:00
heckflosse
087e438cdf Fix coverity issues 2018-11-20 15:45:13 +01:00
heckflosse
074560def0 Merge branch 'dev' into floatdng 2018-11-18 11:38:09 +01:00
heckflosse
50936b2447 Fix two coverity issues 2018-11-17 01:30:59 +01:00
heckflosse
7a84f8211e Show 'Could not extract thumb from ...' only in verbose mode, closes #4984 2018-11-13 22:22:09 +01:00
Hombre
7474598ebc Fix a crash that can occure when creating the thumbnail (no issue) 2018-11-03 13:59:04 +01:00
Alberto Griggio
5e30b5ac58 merged 'colortoning-labregions' into 'dev' 2018-11-01 15:18:11 +01:00
Ingo Weyrich
0bb5d26ed0 Merge pull request #4908 from Beep6581/getridoffeahistogramcache
Get rid of aehistogram files in RT cache.

Merged to get more tests. Issue and pr stay open for a while
2018-10-31 21:56:00 +01:00
Alberto Griggio
7090730063 Merge pull request #4898 from Beep6581/dehaze
Dehaze
2018-10-31 13:26:08 -05:00
heckflosse
f6c864d477 Get rid of aehistogram files in RT cache, fixes #4904 2018-10-31 15:02:53 +01:00
Alberto Griggio
632c1362c8 DNG: honour the BaselineExposure tag 2018-10-28 17:32:15 +01:00
Alberto Griggio
1a3fd9f157 Added new color toning method "L*a*b* regions"
Allows to specify various "regions" of the image with masks, and to correct
for hue, saturation and lightness.

Inspired by the existing L*a*b* grid (in turn taken from darktable)
2018-10-25 16:46:11 +02:00
Alberto Griggio
75964dfd8b make sure that dehaze doesn't trigger Fattal tone mapping
(bad interaction due to sloppy rebasing)
2018-10-10 17:08:36 +02:00
Alberto Griggio
14ac4babec added haze removal tool
Based on the paper:
  "Single Image Haze Removal Using Dark Channel Prior" by He, Sun and Tang
using a guided filter for the "soft matting" of the transmission map
2018-10-10 10:02:06 +02:00
luz.paz
5f867be0c3 Misc. typo tixes 2018-07-31 13:14:14 -04:00
Alberto Griggio
fce2d61b0c moved softlight later in the pipeline
Gives a better result, more suitable to the final fine-tuning
2018-07-24 17:00:54 +02:00
Hombre
180277778a Merge branch 'dev' into testoutputprofile 2018-07-09 22:12:08 +02:00
heckflosse
7f897e4e4d fix #4669 also for xtrans 2018-07-07 16:39:28 +02:00
heckflosse
9224d6e18c Floating point dng files in [0;1] range have black thumbnail, fixes #4669 2018-07-07 16:09:37 +02:00
Hombre
f2b339fc66 Taking care of backward compatibility for new output profiles
see #4478
2018-07-05 23:32:46 +02:00