// Copyright 2003 Matt Sandstršm/Too Much Too Soon // This script is freeware, meaning you may copy and // distribute it free of charge, as long as it's kept intact, // including this message. Feel free to use the code as // inspiration for your own scripts, but don't steal. // Email me at mattias@beauty.se if you have any questions. // Thank you. Have fun. filter "Diffusion"; group "TMTS Stylize"; input tp, "Type", Popup, 2, "Uniform", "Highlights", "Shadows"; input ib, "Amount", slider, 25, 0, 100 input op, "Opacity", slider, 50, 0, 100 input apply, "Mode", Popup, 1, "Normal", "Add", "Subtract", "Difference", "Multiply", "Screen", "Overlay", "Darken", "Lighten"; InformationFlag("YUVaware") code // *************** global variables ************** float w,h; dimensionsof(dest,w,h); image buf1[w][h]; // *************** the effect ************** if (getPixelFormat(dest) != kFormatYUV219) ConvertImage(src1, src1, kFormatYUV219); end if; blur(src1,buf1,ib,aspectof(buf1)); if tp > 1; channelcopy(buf1,buf1,kred,knone,knone,knone); end if; if tp == 3; invertchannel(buf1,buf1,1,0,0,0); end if; // *************** create composite ************** if apply==1; matte(buf1, src1, dest, op/100, kalpha); end if if apply==2; add(src1, buf1, dest, op/100, kalpha); end if if apply==3; subtract(src1, buf1, dest, op/100, kalpha); end if if apply==4; difference(src1, buf1, dest, kalpha); end if if apply==5; multiply(src1, buf1, dest, op/100, kalpha); end if if apply==6; screen(src1, buf1, dest, op/100, kalpha); end if if apply==7; overlay(src1, buf1, dest, op/100, kalpha); end if if apply==8; darken(src1, buf1, dest, op/100, kalpha); end if if apply==9; lighten(src1, buf1, dest, op/100, kalpha); end if