subtype idKGScriptParserduration?ð framebaseencodingparms inputFormat inputCountpublicurltitlewww.fxscript.orguitype typedefaultstringvaluesoftness thresholdminmaxC€CpCp edgefeatherradiusDz@ @ rampB¾useoriginalcoloursUse Original Colours glowcolour1 glow colourÿÿÿÿÿÿÿÿ compositemodeComposite Modeuiinfolabelsmattescreenmultiplyoverlayadd?€@ @ @ amountamountDB B B privatestaticsscript //stib's glow. A filter using the RGBcolourKey function to do a cheap n cheerfiul glow //Copyright 2004 stephen dixon //This filter is freeware, released under the GPL license. //You can do what you want with it as long as you leave it unencoded and include this message. filter "glow" group "stib's filters" producesAlpha; input url, "www.fxscript.org", Label, "string" input softness, "threshold", slider, 240, 0, 256; input edgefeather, "radius", slider, 5, 0, 1000 ramp 95; input UseOriginalColours, "Use Original Colours", CheckBox, 0 input glowColour1, "glow colour", Color, 255, 255, 255, 255 input CompositeMode, "Composite Mode", Popup, 5, "matte", "screen", "multiply", "overlay", "add" input amount, "amount", slider, 80, 0, 600 ramp 80 //nb this version is able to go over 100 percent Code UseOriginalColours = !UseOriginalColours amount /= 100 float w,h,BlendAmount, softnessFactor, i, j, k; float CLUT_a[256], CLUT_r[256], CLUT_g[256], CLUT_b[256]; color KeyColour dimensionsof(dest,w,h); image buf1[w][h], buf2[w][h], buf3[w][h]; //select the highlight area to become our glow //using a colour key with black KeyColour = {0,0,0,0} RGBColorKey(src1, buf1, KeyColour.r, softness, KeyColour.g, softness, KeyColour.b, softness, softness, 1) //fill the rgb channels of our key image with either our glow colour or the src image colour if UseOriginalColours ChannelFill(buf1, kNone, glowColour1.r, glowColour1.g, glowColour1.b) else ChannelCopy(src1, buf1, Knone, kRed, kGreen, kBlue) end if; //feather our glow as user selects blur(buf1, buf2, edgefeather, aspectof(dest)) if CompositeMode == 1 //matte Matte(buf2, src1, dest, amount, kAlpha)//matte amount-=1 repeat while (amount > 0) //to acheive result of over 100 percent we reiterate the process Matte(buf2, dest, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 2 Screen(src1, buf2, dest, amount, kAlpha)//screen amount-=1 repeat while (amount > 0) Screen(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 3 Multiply(src1, buf2, dest, amount, kAlpha)//mult amount-=1 repeat while (amount > 0) Multiply(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 4 Overlay(src1, buf2, dest, amount, kAlpha)//overlay amount-=1 repeat while (amount > 0) Overlay(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat else if CompositeMode == 5 Add(src1, buf2, dest, amount, kAlpha) amount-=1 repeat while (amount > 0) Add(dest, buf2, dest, amount, kAlpha) amount-=1 end repeat end ifnameglowscriptid;groupstib's filters producesalphaencoded