// Copyright 2009 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 "Warp Sharp"; group "TMTS Stylize"; InformationFlag("YUVaware") input amount, "Amount", slider, 3, 0, 10; code float w,h,k[2][3][3],i; dimensionsof(dest,w,h); image buf1[w][h],buf2[w][h],buff[w][h],thesource[w][h]; if GetPixelFormat(src1) != kFormatYUV219; setpixelformat(thesource, kFormatYUV219) ConvertImage(src1, thesource, kFormatYUV219) else thesource = src1 end if k[0]={-1,0,1,-2,0,2,-1,0,1}; k[1]={-1,-2,-1,0,0,0,1,2,1}; channelfill(buff,0,0,0,0); for i = 0 to 1 convolve(thesource, buf2, k[i], 1, 0); add(buf2,buff,buff,1,knone); k[i] *= -1; convolve(thesource, buf2, k[i], 1, 0); add(buf2,buff,buff,1,knone); next; desaturate(buff,buf1); blur(buf1,buff,sqrt(amount),aspectof(dest)); convolve(buff, buf1, k[0], 1, 128); convolve(buff, buf2, k[1], 1, 128); displace(src1, buff, buf1, 1, amount/500, 0, 0, aspectof(dest)); displace(buff, dest, buf2, 1, 0, amount/500, 0, aspectof(dest));