diff --git a/rtdata/languages/default b/rtdata/languages/default index 9df4cdbe5..24904c99f 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2242,7 +2242,7 @@ TP_LOCALLAB_CHROMASK_TOOLTIP;You can use this slider to desaturated background ( TP_LOCALLAB_CHRRT;Chroma TP_LOCALLAB_CIRCRADIUS;Spot size TP_LOCALLAB_CLARICRES;Merge Chroma -TP_LOCALLAB_CLARIFRA;Clarity & Sharp mask - Blend images +TP_LOCALLAB_CLARIFRA;Clarity & Sharp mask - Blend & Soft images TP_LOCALLAB_CLARILRES;Merge Luma TP_LOCALLAB_CLARISOFT;Soft radius TP_LOCALLAB_CLARITYML;Clarity @@ -2252,9 +2252,9 @@ TP_LOCALLAB_COFR;Color & Light - Small defects TP_LOCALLAB_COL_NAME;Name TP_LOCALLAB_COL_VIS;Status TP_LOCALLAB_COMPFRA;Levels Dynamic Laplacian Range Compression ƒ -TP_LOCALLAB_COMPREFRA;Levels Dynamic Wavelet Range Compression -TP_LOCALLAB_COMPRESS_TOOLTIP;Use if necessary the module 'Clarity & Sharp mask and Blend images' by adjusting 'Soft radius' to reduce artifacts. -TP_LOCALLAB_COMPFRAME_TOOLTIP;Allows special effects. You can reduce artifacts with 'Clarity & Sharp mask - Blend Images".\nUses a lot of resources +TP_LOCALLAB_COMPREFRA;Levels Dynamic Wavelet Range (un)Compression +TP_LOCALLAB_COMPRESS_TOOLTIP;Use if necessary the module 'Clarity & Sharp mask and Blend & Soft Images' by adjusting 'Soft radius' to reduce artifacts. +TP_LOCALLAB_COMPFRAME_TOOLTIP;Allows special effects. You can reduce artifacts with 'Clarity & Sharp mask - Blend & Soft Images".\nUses a lot of resources TP_LOCALLAB_COMPLEX_METHOD;Software Complexity TP_LOCALLAB_COMPLEX_TOOLTIP; Allow user to select Local adjustements rubrics. TP_LOCALLAB_CONTCOL;Contrast threshold Mask Blur @@ -2625,7 +2625,7 @@ TP_LOCALLAB_WARM;Warm - Cool & Color artifacts TP_LOCALLAB_WARM_TOOLTIP;This slider use Ciecam algorithm and acts as White Balance, it can warm or cool the area selected.\nIt can also in some cases reduce color artifacts. TP_LOCALLAB_WAV;Levels local contrast TP_LOCALLAB_WAVCOMP;Compression by Level -TP_LOCALLAB_WAVCOMPRE;Compression by Level +TP_LOCALLAB_WAVCOMPRE;(un)Compression by Level TP_LOCALLAB_WAVCON;Contrast by Level TP_LOCALLAB_WAVDEN;Luminance denoise by level (0 1 2 + 3 and more) TP_LOCALLAB_WASDEN_TOOLTIP;Denoise luminance for the 3 first levels (fine).\nThe right limit of the curve correspond to coarse : level 3 and beyond diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index d9e60eac3..6a98b3c47 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -210,7 +210,7 @@ public: void EPDToneMapResid(float * WavCoeffs_L0, unsigned int Iterates, int skip, struct cont_params& cp, int W_L, int H_L, float max0, float min0); void CompressDR(float *Source, int W_L, int H_L, float Compression, float DetailBoost); - void Compresslevels(float **Source, int W_L, int H_L, float compression, float detailBoost, float thres);//, float maxp, float maxn); + void Compresslevels(float **Source, int W_L, int H_L, float compression, float detailattenuator, float thres);//, float maxp, float maxn); void ContrastResid(float * WavCoeffs_L0, struct cont_params &cp, int W_L, int H_L, float max0, float min0); void EPDToneMap(LabImage *lab, unsigned int Iterates = 0, int skip = 1); diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index cbc2dc07f..1e5b64e92 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -7044,24 +7044,24 @@ void ImProcFunctions::wavcbd(wavelet_decomposition &wdspot, int level_bl, int ma } -void ImProcFunctions::Compresslevels(float **Source, int W_L, int H_L, float compression, float detailBoost, float thres)//, float maxp, float maxn) +void ImProcFunctions::Compresslevels(float **Source, int W_L, int H_L, float compression, float detailattenuator, float thres)//, float maxp, float maxn) { //J.Desmis 12-2019 float exponent; // printf("maxp=%f maxn=%f\n", maxp, maxn); - if (detailBoost > 0.f && detailBoost < 0.05f) { - float betemp = expf(-(2.f - detailBoost + 0.693147f)) - 1.f; //0.69315 = log(2) + if (detailattenuator > 0.f && detailattenuator < 0.05f) { + float betemp = expf(-(2.f - detailattenuator + 0.693147f)) - 1.f; //0.69315 = log(2) exponent = 1.2f * xlogf(-betemp); exponent /= 20.f; - } else if (detailBoost >= 0.05f && detailBoost < 0.25f) { - float betemp = expf(-(2.f - detailBoost + 0.693147f)) - 1.f; + } else if (detailattenuator >= 0.05f && detailattenuator < 0.25f) { + float betemp = expf(-(2.f - detailattenuator + 0.693147f)) - 1.f; exponent = 1.2f * xlogf(-betemp); - exponent /= (-75.f * detailBoost + 23.75f); - } else if (detailBoost >= 0.25f) { - float betemp = expf(-(2.f - detailBoost + 0.693147f)) - 1.f; + exponent /= (-75.f * detailattenuator + 23.75f); + } else if (detailattenuator >= 0.25f) { + float betemp = expf(-(2.f - detailattenuator + 0.693147f)) - 1.f; exponent = 1.2f * xlogf(-betemp); - exponent /= (-2.f * detailBoost + 5.5f); + exponent /= (-2.f * detailattenuator + 5.5f); } else { exponent = (compression - 1.0f) / 20.f; } @@ -7164,24 +7164,26 @@ void ImProcFunctions::wavcont(wavelet_decomposition &wdspot, float ****templevel int W_L = wdspot.level_W(level); int H_L = wdspot.level_H(level); if (loccomprewavCurve && loccomprewavutili) { - float klev = 2.f * (loccomprewavCurve[level * 55.5f] - 0.5f); + float klev =(loccomprewavCurve[level * 55.5f] - 0.75f); if (klev < 0.f) { - klev *= 2.f; + klev *= 2.6666f;//compression increase contraste + } else { + klev *= 4.f;//dilatation reduce contraste - detailattenuator } float compression = expf(-klev); - float detailBoost = klev; + float detailattenuator = klev; if (klev < 0.0f) { - detailBoost = 0.0f; + detailattenuator = 0.0f; } float thresref = mean[level]; - float thresreal = 0.1f * thres * thresref;//to take into account noise and artifacts + float thresreal = 0.1f * thres * thresref;//small values to take into account noise and artifacts // printf("mean=%f sig=%f\n", mean[level], sigma[level]); - Compresslevels(templevel[dir - 1][level], W_L, H_L, compression, detailBoost, thresreal);//, MaxP[level], MaxN[level]); + Compresslevels(templevel[dir - 1][level], W_L, H_L, compression, detailattenuator, thresreal);//, MaxP[level], MaxN[level]); } } } @@ -11378,7 +11380,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o if (loccomprewavCurve && loccomprewavutili) { if (lp.locmet == 1) { for (int i = 0; i < 500; i++) { - if (loccomprewavCurve[i] != 0.5) { + if (loccomprewavCurve[i] != 0.75) { wavcurvecompre = true; } } @@ -11572,8 +11574,8 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o float mL = (float)(params->locallab.spots.at(sp).clarilres / 100.f); float mC = (float)(params->locallab.spots.at(sp).claricres / 100.f); float softr = (float)(params->locallab.spots.at(sp).clarisoft); - float mL0; - float mC0; + float mL0 = 0.f; + float mC0 = 0.f; #ifdef _OPENMP const int numThreads = omp_get_max_threads(); #else @@ -11780,7 +11782,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o mL0 = mL = mC0 = mC = 0.f; } - if (exec) { + if (exec || compreena) { bool origl = false; // origlc = false; LabImage *mergfile = origl ? tmpres.get() : tmp1.get(); @@ -11796,7 +11798,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o tmp1->b[x][y] = CLIPC((1.f + mC0) * mergfile->b[x][y] - mC * tmpresid->b[x][y]); } - if (softr > 0.f && fabs(mL) > 0.001f) { + if (softr > 0.f && (compreena || fabs(mL) > 0.001f)) { softproc(tmpres.get(), tmp1.get(), softr, bfh, bfw, 0.0001, 0.00001, thr, sk, multiThread, flag); } } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 26c824f0b..9dff56c5c 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2735,10 +2735,10 @@ LocallabParams::LocallabSpot::LocallabSpot() : fatdet(40.0), fatanch(50.0), fatres(0.0), - clarilres(0.5), + clarilres(0.0), claricres(0.0), clarisoft(1.0), - sensilc(19), + sensilc(30), fftwlc(false), blurlc(true), wavblur(false), @@ -2752,7 +2752,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : loclevwavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.0, 0.0, 0.35, 0.5, 0., 0.35, 0.35, 1.0, 0.0, 0.35, 0.35}, locconwavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.5, 0.35, 0.35, 1., 0.5, 0.35, 0.35}, loccompwavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.0, 0.0, 0.35, 0.5, 0., 0.35, 0.35, 1.0, 0.0, 0.35, 0.35}, - loccomprewavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.5, 0.35, 0.35, 1., 0.5, 0.35, 0.35}, + loccomprewavcurve{(double)FCT_MinMaxCPoints, 0.0, 0.75, 0.35, 0.35, 1., 0.75, 0.35, 0.35}, CCmasklccurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35 }, LLmasklccurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, HHmasklccurve{(double)FCT_MinMaxCPoints, 0.0, 1.0, 0.35, 0.35, 0.50, 1.0, 0.35, 0.35, 1.0, 1.0, 0.35, 0.35}, diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 72f7bef9f..ca5422334 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -574,10 +574,10 @@ levelwav(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELWAV"), 1, 9, 1, 4))), residcont(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCONT"), -100, 100, 1, 0))), residblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDBLUR"), 0., 100., 0.5, 0.))), levelblur(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LEVELBLUR"), 0., 100., 0.5, 0.))), -clarilres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARILRES"), -20., 100., 0.5, 0.5))), +clarilres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARILRES"), -20., 100., 0.5, 0.))), clarisoft(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SOFTRADIUSCOL"), -10.0, 1000.0, 0.5, 1.))), claricres(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CLARICRES"), -20., 100., 0.5, 0.))), -sensilc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 19))), +sensilc(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIS"), 0, 100, 1, 30))), residchro(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCHRO"), -100., 100., 1., 0.))), residcomp(Gtk::manage(new Adjuster(M("TP_LOCALLAB_RESIDCOMP"), -1., 1., 0.01, 0.))), sigma(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SIGMAWAV"), 0.2, 2.5, 0.01, 1.))),