From: Till Theato Date: Sat, 10 Sep 2011 21:31:29 +0000 (+0000) Subject: Add support for light graffiti effect version 0.2. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1867570cb8df3fbde5f5da77055cd8ba6597fa5b;p=kdenlive Add support for light graffiti effect version 0.2. svn path=/trunk/kdenlive/; revision=5909 --- diff --git a/effects/frei0r_lightgraffiti.xml b/effects/frei0r_lightgraffiti.xml index 9940897e..acf331e2 100644 --- a/effects/frei0r_lightgraffiti.xml +++ b/effects/frei0r_lightgraffiti.xml @@ -1,5 +1,6 @@ - + + Light Graffiti Light Graffiti effect. Reset Resets the light mask and the background image. This is necessary e.g. if you apply this effect to a clip in the timeline and then move the timeline cursor from outside of the clip to the middle of it. The effect receives this frame in the middle as first frame and uses it as background image. For proper threshold adjusting move the timeline cursor to the beginning of the clip, check the Reset box and uncheck it again. - + + + + Light Graffiti + Light Graffiti effect. + + Simon A. Eugster (Granjow) + + Brightness Threshold + R+G+B) does a pixel need to be in order to be recognized as a light source?
+ Increasing this threshold requires brighter light sources (i.e. more white or less color, respectively) but prevents some «false alarms» where semi-bright parts, e.g. hands where colors can change quite a lot compared to the background, are incorrectly recognized as light source.]]>
+
+ + Difference Threshold + max(dR, dG, dB)), in order to be recognized as light source?
+ Increasing this threshold makes it harder for light sources to be accepted on bright backgrounds, but decreases the danger of noise or generally bright spots counting as light source.]]>
+
+ + Difference Sum Threshold + relative to the background image (dR + dG + dB) have to change until a pixel is recognized as a light source?
+ Raising this value might, in some cases, avoid that some light objects lit by the light source are added to the light mask.]]>
+
+ + Sensitivity + + For slowly moving light source try to use a lower sensitivity to obtain a better exposure.]]> + + + Lower Overexposure + + The light mask does not get white immediately when the light source is moving slowly or staying steady.]]> + + + Dimming + Dims the light mask. Lights will leave a fainting trail if it is set to a value > 0. + + + Background Weight + Strength of the (calculated) background image. Setting it to 100 paints the light mask directly over the background, without the painting person in the image if the video starts with a «clean» background image. (See the α parameter.) + + + α + + The Light Graffiti effect remembers the first frame of the clip it is applied to, so the clip should always start with the painter outside of the video. If the background constantly changes, e.g. on a street, try to set α > 0 to calculate an average background image.]]> + + + Saturation + Increases the saturation of lights. + + + Show brightness statistics + + Example: To adjust the brightness threshold, check this box and adjust the threshold until the whole light source is highlighted. Repeat the same with the other parameters. Only parts that are highlighted in all thresholds will count as light source.]]> + + + Show background difference statistics + + + Show background difference sum statistics + + + Transparent Background + Makes the background transparent, allowing to apply a composite effect and paint the light mask over a completely different video. + + + Nonlinear dimming + If normal dimming does not look natural enough, try this one. + + + Reset + Resets the light mask and the background image. This is necessary e.g. if you apply this effect to a clip in the timeline and then move the timeline cursor from outside of the clip to the middle of it. The effect receives this frame in the middle as first frame and uses it as background image. For proper threshold adjusting move the timeline cursor to the beginning of the clip, check the Reset box and uncheck it again. + +
+ diff --git a/effects/update/CMakeLists.txt b/effects/update/CMakeLists.txt index bd1a07aa..0112dd0f 100644 --- a/effects/update/CMakeLists.txt +++ b/effects/update/CMakeLists.txt @@ -4,5 +4,6 @@ frei0r.balanc0r.js frei0r.cartoon.js frei0r.curves.js frei0r.levels.js +frei0r.lightgraffiti.js frei0r.vertigo.js DESTINATION ${DATA_INSTALL_DIR}/kdenlive/effects/update) diff --git a/effects/update/frei0r.lightgraffiti.js b/effects/update/frei0r.lightgraffiti.js new file mode 100644 index 00000000..34476e74 --- /dev/null +++ b/effects/update/frei0r.lightgraffiti.js @@ -0,0 +1,19 @@ + +var update = new Object(); + +update["sensitivity"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 5.); })); +update["thresholdBrightness"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 765.); })); +update["thresholdDifference"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 255.); })); +update["thresholdDiffSum"] = update["thresholdBrightness"]; +update["saturation"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 4.); })); +update["lowerOverexposure"] = new Array(new Array(0.2, function(v, d) { return this.upd1(v, d, 10.); })); + +function upd1(value, isDowngrade, factor) { + var valueList = value.split(';'); + var locale = new QLocale(); + for (var i = 0; i < valueList.length; ++i) { + var current = valueList[i].split('='); + valueList[i] = current[0] + '=' + locale.toString(isDowngrade ? current[1] * factor : current[1] / factor); + } + return valueList.join(';'); +}