this version saves out 32bit TGA files with their alpha channels
//set up preferences.rulerUnits = Units.PERCENT displayDialogs = DialogModes.NO //Doc Info var docRef = app.documents var typeLayer = app.activeDocument.artLayers.add(); typeLayer.name = app.activeDocument.name.slice(0,-4); // Save as a new TGA file with these options. var Options = new TargaSaveOptions(); Options.alphaChannels = true; Options.resolution = TargaBitsPerPixels.THIRTYTWO; Options.rleCompression = false; //make HalfRes var resize = docRef.resizeImage( 50,50 ) var saveFile = new File(decodeURI(activeDocument.fullName.fsName).slice(0,-4) + "_med.tga"); app.activeDocument.saveAs (saveFile, Options, false, Extension.LOWERCASE); //make QuaterRes var resize = docRef.resizeImage( 50,50 ) var saveFile = new File(decodeURI(activeDocument.fullName.fsName).slice(0,-4) + "_low.tga"); app.activeDocument.saveAs (saveFile, Options, false, Extension.LOWERCASE); //close without saving app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
a modified version by simply changing the save options & file extensions allows you to just about any format, we also use the PNG format so therefore
// Save as a new PNG file with these options. var options = new PNGSaveOptions();
is switched out to save PNGs.
// Save as a new TIF file with these options. var Options = new TiffSaveOptions(); Options.alphaChannels = true;
is switched out to save TIFs.
I have put them both into a Zip File with instructions on how to install and use, and that is Downloadable Here!!