// 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 "Black & White" group "TMTS Color" input r, "Red", slider, 30, 0, 100 input g, "Green", slider, 60, 0, 100 input b, "Blue", slider, 10, 0, 100 input keep, "Maintain brightness", Checkbox, 1 InformationFlag("YUVaware") code if keep == 1 then r = (r * 100) / (r+g+b); g = (g * 100) / (r+g+b); b = (b * 100) / (r+g+b); end if; ConvertImage(src1, src1, kFormatRGB219) setpixelformat(dest, kFormatRGB219); float offset0[3], offset128[3], mat[3][3]; offset128 = { 0, 128, 128 } mat = {r/100, 0, 0, g/100, 0, 0, b/100, 0, 0}; colorTransform(src1, dest, mat, offset0, offset128); setpixelformat(dest, kFormatYUV219);