var savefile=new File("~/Desktop/exp.gif"); var exportOptions = new ExportOptionsGIF(); exportOptions.infoLossPercent = 50; // 50% app.activeDocument.exportFile(savefile, ExportType.GIF, exportOptions);