]> git.sesse.net Git - kdenlive/commitdiff
Add support for light graffiti effect version 0.2.
authorTill Theato <root@ttill.de>
Sat, 10 Sep 2011 21:31:29 +0000 (21:31 +0000)
committerTill Theato <root@ttill.de>
Sat, 10 Sep 2011 21:31:29 +0000 (21:31 +0000)
svn path=/trunk/kdenlive/; revision=5909

effects/frei0r_lightgraffiti.xml
effects/update/CMakeLists.txt
effects/update/frei0r.lightgraffiti.js [new file with mode: 0644]

index 9940897e8ef2facc147bab770a43bae21799fbb0..acf331e21a15dc90bc2fc6184c3a299371b18ee0 100644 (file)
@@ -1,5 +1,6 @@
 <!DOCTYPE kpartgui>
-<effect tag="frei0r.lightgraffiti" id="frei0r.lightgraffiti">
+<group>
+    <effect tag="frei0r.lightgraffiti" id="frei0r.lightgraffiti">
         <name>Light Graffiti</name>
         <description>Light Graffiti effect.
         <full><![CDATA[This effect allows to do Light Painting (i.e. painting with light sources on a photo by keeping the shutter
             <name>Reset</name>
             <comment>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.</comment>
         </parameter>
-</effect>
+    </effect>
+
+    <effect LC_NUMERIC="C" tag="frei0r.lightgraffiti" id="frei0r.lightgraffiti" version="0.2">
+        <name>Light Graffiti</name>
+        <description>Light Graffiti effect.
+        <full><![CDATA[This effect allows to do Light Painting (i.e. painting with light sources on a photo by keeping the shutter
+        opened for a while), but for video.]]></full></description>
+        <author>Simon A. Eugster (Granjow)</author>
+        <parameter type="simplekeyframe" name="thresholdBrightness" default="450" min="0" max="765" factor="765">
+            <name>Brightness Threshold</name>
+            <comment><![CDATA[How bright (<code>R+G+B</code>) does a pixel need to be in order to be recognized as a light source?<br/>
+            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.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="thresholdDifference" default="80" min="0" max="255" factor="255">
+            <name>Difference Threshold</name>
+            <comment><![CDATA[How much does the strongest color channel of a pixel have to change, compared to the background image (<code>max(dR, dG, dB)</code>), in order to be recognized as light source? <br/>
+            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.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="thresholdDiffSum" default="0" min="0" max="765" factor="765">
+            <name>Difference Sum Threshold</name>
+            <comment><![CDATA[How much does the sum of all color channels <em>relative to the background image</em> (<code>dR + dG + dB</code>) have to change until a pixel is recognized as a light source?<br/>
+            Raising this value might, in some cases, avoid that some light objects lit by the light source are added to the light mask.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="sensitivity" default="100" min="0" max="500" factor="500">
+            <name>Sensitivity</name>
+            <comment><![CDATA[Light sensitivity.<br/>
+            For slowly moving light source try to use a lower sensitivity to obtain a better exposure.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="lowerOverexposure" default="0" min="0" max="10" factor="10">
+            <name>Lower Overexposure</name>
+            <comment><![CDATA[Lowers overexposure.<br/>
+            The light mask does not get white immediately when the light source is moving slowly or staying steady.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="dim" default="0" min="0" max="255" factor="255">
+            <name>Dimming</name>
+            <comment>Dims the light mask. Lights will leave a fainting trail if it is set to a value > 0.</comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="backgroundWeight" default="0" min="0" max="100" factor="100">
+            <name>Background Weight</name>
+            <comment>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.)</comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="longAlpha" default="0" min="0" max="256" factor="256">
+            <name>α</name>
+            <comment><![CDATA[Determines how the effect tries to adapt to background changes. <br/>
+            The Light Graffiti effect remembers the first frame of the clip it is applied to, so the clip should <em>always</em> 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.]]></comment>
+        </parameter>
+        <parameter type="simplekeyframe" name="saturation" default="150" min="0" max="400" factor="400">
+            <name>Saturation</name>
+            <comment>Increases the saturation of lights.</comment>
+        </parameter>
+        <parameter type="bool" name="statsBrightness" default="0">
+            <name>Show brightness statistics</name>
+            <comment><![CDATA[The stats switches allow easy and accurate adjustment of the threshold parameters.<br/>
+            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 <em>all</em> thresholds will count as light source.]]></comment>
+        </parameter>
+        <parameter type="bool" name="statsDifference" default="0">
+            <name>Show background difference statistics</name>
+        </parameter>
+        <parameter type="bool" name="statsDiffSum" default="0">
+            <name>Show background difference sum statistics</name>
+        </parameter>
+        <parameter type="bool" name="transparentBackground" default="0">
+            <name>Transparent Background</name>
+            <comment>Makes the background transparent, allowing to apply a composite effect and paint the light mask over a completely different video.</comment>
+        </parameter>
+        <parameter type="bool" name="nonlinearDim" default="0">
+            <name>Nonlinear dimming</name>
+            <comment>If normal dimming does not look natural enough, try this one.</comment>
+        </parameter>
+        <parameter type="bool" name="reset" default="0">
+            <name>Reset</name>
+            <comment>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.</comment>
+        </parameter>
+    </effect>
+</group>
index bd1a07aa8a7772dd4a277691e815bc12b6077627..0112dd0f56c7add4d516bda7455164e8fd1de816 100644 (file)
@@ -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 (file)
index 0000000..34476e7
--- /dev/null
@@ -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(';');
+}