In the darktable “color balance rgb” module, there is a slider “global vibrance”. I used the middle column (original) of the posted example and opened it in darktable 3.8. Besides “color balance rgb” I only activated filmic rgb with default settings.
The result below is in no way identical to the posted example but quite similar.
I noticed, and he gave me his code. Based on the code provided by the person I mentioned (shame to see him go), I have made my translation for G’MIC. It’s the same except for chroma boost.
#@cli rep_ych_vibrance: 0<vibrance<=1
#@cli : Increase Chroma of Image with minimal to no impact on high-chroma areas. Based on Darktable YCH "Vibrance" code.
rep_ych_vibrance:
vibrance={cut(abs($1),0,1)}
if !$vibrance return fi
foreach {
if s<3||s>4 continue fi
if s==4 sh. 0,2 fi
rgb2yiq.
sh. 1,2
f. "
V=I;
[norm(V),atan2(V[1],V[0])];"
sh. 0
f. "begin(
const vibrance=$vibrance;
);
v=vibrance*(1-i^vibrance);
chroma_factor=max(0,1+vibrance);
i*chroma_factor;"
f.. "
polar_coordinates=I;
r=polar_coordinates[0];
ang=polar_coordinates[1];
[r*cos(ang),r*sin(ang)];
"
k[0]
yiq2rgb
}
This one utilize the YCH model instead of RGB model.
I noticed some details may be lost on images with already high chroma, I think that’s my fault, but oh well.
Also, I can’t tell what’s better at times. The RGB approach or the YCH approach. YCH is worse on green, but RGB is worse at other colors. I will say that YCH approaches preserve some information better, and is generally a improvement in some case.
EDIT in 6/29/2022: Polar version of YIQ is better than YUV according to my recent experiment.
Now, I just did, but decided to go through srgb2rgb, and then rgb2srgb as that seem to preserve information some more. I also added better weighing. It still has color bleed, but that probably because of the out-of-gamut issue, and at that point, I don’t think I can do much more.
Earlier in this thread I mentioned a GIMP plug-in I had created.
I have now made a simplified version that makes it possible to increase or reduce the saturation in both the high and low saturation regions of an image. It also runs somewhat quicker (but still slow, because it is written in Python 2.7xx).
It creates two masked layers above the original, one of which contains the high saturation parts, the other the low. After adjustment the layers can be merged down.
I have also “stretched” the mask in the hope that it will give a usable amount of change where the saturation range of the original image is small.
I have attached it here and hope to receive comments, suggestions and criticism!
After testing some more of Vibrance / Vibrance [YCH], and working on Vibrance [YCH] (Note that G’MIC can’t be updated during this week). It seems that Vibrance [YCH] actually preserves perceptual luminosity better than Vibrance. I actually have compared it with Ed’s Harvey Vibrance plugin for Paint.NET.
I ranked from best to worst:
Ed Harvey’s Vibrance - This preserves luminosity better than Vibrance [YCH], but it isn’t that much better. And also preserves saturation better at 100%. Sometimes this performs worse than Vibrance[YCH]. Basically 52/48.
Vibrance [YCH] - Performs a slightly worse than the above. However, extremely close to the above, so they’re interchangeable, and there are few cases where this is better than the above. Clearly need of a improvement.
Vibrance - This one has glaring issue with really high chroma image on high vibrance.
What I think that may improve my Vibrance [YCH] is either switching to a different color space, or modify the YUV color space so that it matches one of the gmic rgb2lab illuminant. There’s another possible way to make it better, a modified version of rgb2srgb/srgb2rgb. Or even both. That way, we finally have a proper Vibrance filter as luminosity would be better perserved in some areas. However, improvement could mean trying to grasp it and then finding a better mathematical model.
Your Vibrance [YCH] could be improved with a color space where the most rgb saturated color (for example red [1,0,0]) is mapped to a value of 1.0 in the chroma/saturation channel, this is the only way to limit or not push at all colors out of gamut.