Photoshop Slit Scan Video Filter
This is a Javascript filter for Photoshop CS2 that takes an image and vertically stretches each line of pixels into one whole frame. It generates a series of images that, when used as video frames, create long vertical pan (slit scan) down the image.
The Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
This script works with a single jpg image. it creates a document for each horizontal line of pixels, then expands that line to fill up an entire frame. Use this to create a cool stripe effect. Cobbled together by Chris Reilly [creilly 4T saic D0T edu] in 2007. This script is distributed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License see http://creativecommons.org/licenses/by-nc-sa/3.0/ for details */ app.preferences.rulerUnits = Units.PIXELS; alert ("Select the source image file to generate from"); var originalFilePath = File.openDialog("Select the source image file to generate from"); var sourceFile = new File(originalFilePath); open (sourceFile); var filename = sourceFile.name.substr(0,(sourceFile.name.length - 4)); originalFrame = app.documents.getByName(sourceFile.name); var outputFolder = new Folder(); var outputFolderPath = outputFolder.selectDlg("Select the folder to save generated files"); var linecount = 0 for (linecount; linecount < originalFrame.height; linecount++) // this will cycle through each vertical line of pixels in the original frame file enumerated by filename = mainframecount + 1000000 //linecount usually equal to 0 { originalFrame.selection.select(new Array (new Array(0,linecount),new Array(originalFrame.width,linecount), new Array(originalFrame.width,(linecount + 1)), new Array(0,(linecount + 1)))); originalFrame.selection.copy(); var output_filename = parseFloat(filename) + "_" + parseFloat(linecount) + ".jpg"; app.documents.add(originalFrame.width, originalFrame.height, 72.0, filename + "_" + linecount + ".jpg"); activeDocument.selection.select(new Array (new Array(0,0),new Array(originalFrame.width,0), new Array(originalFrame.width,1), new Array(0,1)),SelectionType.REPLACE, 0, false); activeDocument.paste(); activeDocument.flatten(); for( var count2 = 0; count2 < 9; count2++) { activeDocument.selection.select(new Array (new Array(0,0),new Array(originalFrame.width,0), new Array(originalFrame.width,Math.pow(2,count2)), new Array(0,Math.pow(2,count2))),SelectionType.REPLACE, 0, false); activeDocument.selection.copy(); activeDocument.selection.select(new Array (new Array(0,Math.pow(2,count2)),new Array(720,Math.pow(2,count2)), new Array(720,(2 * Math.pow(2,count2))), new Array(0,(2 * Math.pow(2,count2)))),SelectionType.REPLACE, 0, false); activeDocument.paste(); activeDocument.flatten(); } var jpegOptions = new JPEGSaveOptions(); saveDoc = app.documents.getByName(filename + "_" + linecount + ".jpg"); saveDoc.saveAs(new File(outputFolderPath + "/" + filename + "_" + linecount + ".jpg"), jpegOptions); saveDoc.close(); } activeDocument.close(); |