1Script file generated from LiVES 2 3<define> 4|1.7 5</define> 6 7<name> 8transition_bwthresh 9</name> 10 11<version> 121 13</version> 14 15<author> 16Salsaman| 17</author> 18 19<description> 20B/W Threshold|B/W thresholding|0|2| 21</description> 22 23<requires> 24convert 25composite 26</requires> 27 28<params> 29thresh|Thres_hold|num0|8000|0|65535| 30btrans|_Black is transparent|bool|1|1| 31wtrans|_White is transparent|bool|0|1| 32cover|Clipboard _over selection|bool|1|2| 33cunder|Clipboard _under selection|bool|0|2| 34width|_Width|num0|0|0|10000| 35height|_Height|num0|0|0|10000| 36cx|Centre _X|num0|0|0|10000| 37cy|Centre _Y|num0|0|0|10000| 38finf|Frame _in frame position of top frame...|bool|0| 39</params> 40 41<param_window> 42layout|p0|"(0 = no transparency, 65535 = all transparent)"| 43layout|p1|p2| 44layout|hseparator| 45layout|p9| 46layout|p5|p6| 47layout|p7|p8| 48layout|hseparator| 49layout|$p3|$p4| 50</param_window> 51 52<properties> 530x0000 54</properties> 55 56<language_code> 570xF0 58</language_code> 59 60<pre> 61$rwidth=$width; 62$rheight=$height; 63$xoff=$yoff=0; 64 65if ($p9) { 66 $rwidth=$p5; 67 $rheight=$p6; 68 $xoff=$p7-int($rwidth/2.+.5); 69 $yoff=$p8-int($rheight/2.+.5); 70} 71 72</pre> 73 74<loop> 75if ($p3) { 76 # transparent over 77 system("$convert_command +antialias $img_prefix2$in2 -scale $rwidth!x$rheight! resize.png"); 78 if (!$p2) { 79 system("$convert_command resize.png -threshold $p0 -monochrome mask.png"); 80 } 81 else { 82 system("$convert_command resize.png -threshold ".(65535-$p0)." -negate -monochrome mask.png"); 83 } 84 system("$composite_command -compose over -geometry $rwidth!x$rheight! resize.png -geometry +$xoff!+$yoff! -size $width!x$height! $img_prefix$in mask.png $frame.tmp"); 85 } 86 else { 87 #transparent under 88 if ($antialias eq "false") { 89 system("$convert_command +antialias $img_prefix2$in2 -scale $width!x$height! resize.png"); 90 } 91 else { 92 system("$convert_command $img_prefix2$in2 -resize $width!x$height! resize.png"); 93 } 94 system("$convert_command $img_prefix$in -resize $rwidth!x$rheight! resize2.png"); 95 if (!$p2) { 96 system("$convert_command -threshold ".($p0)." resize2.png -monochrome mask.png"); 97 } 98 else { 99 system("$convert_command -threshold ".(65535-$p0)." -negate resize2.png -monochrome mask.png"); 100 } 101 system("$composite_command -compose over -geometry $rwidth!x$rheight! resize2.png -geometry +$xoff!+$yoff! -size $width!x$height! resize.png mask.png $frame.tmp"); 102 } 103 104 system("$convert_command +matte $frame.tmp $out_prefix$out"); 105 unlink "$frame.tmp"; 106</loop> 107 108<post> 109unlink <mask.png resize.png resize2.png>; 110</post> 111 112<onchange> 113init|$p5=$width2; $p5_max=$width; 114init|$p6=$height2; $p6_max=$height; 115init|$p7=int($width/2+.5); 116init|$p8=int($height/2+.5); 1175|$p7_max=$width-1-int($p5/2+.5);$p7_min=int($p5/2+.5); 1186|$p8_max=$height-1-int($p6/2+.5);$p8_min=int($p6/2+.5); 1199|if ($p9) {$p7_max=$width-1-int($p5/2+.5);$p7_min=int($p5/2+.5);$p8_max=$height-1-int($p6/2+.5);$p8_min=int($p6/2+.5);} 120</onchange> 121