Closed Cyril0001 closed 6 years ago
Post a GIF that looks good; the command line you use to run gifsicle; and the result of running gifsicle.
That is how the saved file looks now:
That is as it used to be:
I use the script to batch save animgifs from photoshop. Nothing change, as to my current knowladge :) Here it is.
try{
var Path= activeDocument.path;
}catch(e){var Path = "~/desktop";}
var Name = decodeURI(app.activeDocument.name).replace(/.[^.]+$/, '');
var layerName = app.activeDocument.activeLayer.name.replace(/[:\/\\?\"\<>|]/g, "_");
var saveFile= new File(Path + "/" + Name + "-" + layerName + ".gif");
var rex = new RegExp(Name + "-" + layerName + ".gif");
var files = decodeURI(saveFile.fsName).replace(rex,".gif");
var cmd = 'D:/gifsicle.exe --batch --loop=forever --careful ';
cmd += '\"' + files+ '\"';
SaveForWeb(saveFile);
app.system(cmd);
function SaveForWeb(saveFile) {
var sfwOptions = new ExportOptionsSaveForWeb();
sfwOptions.format = SaveDocumentType.COMPUSERVEGIF;
sfwOptions.includeProfile = false;
sfwOptions.interlaced = 0;
sfwOptions.optimized = true;
sfwOptions.transparency = 1;
sfwOptions.ColorReductionType = ColorReductionType.SELECTIVE;
sfwOptions.dither = Dither.NONE;
sfwOptions.ditherAmount = 80;
sfwOptions.lossy = 8;
sfwOptions.webSnap = 0;
sfwOptions.colors = 256;
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
};
Running gifsicle --loop=forever
on your input GIF produces an indistinguishable output GIF.
Most likely the problem is in your SaveForWeb function, which is doing a number of things, including reducing colors.
Bug reports are only accepted here that concern gifsicle; we can't debug your photoshop batch script. Good luck.
All my animated Gifs start to apear in a very poor quality after gifsicle. Exactly as if you set in Export Option - SaveForWeb - parameter "lossy" to 60. I cannot fight that. Nothing helps so far. Would be very grateful for any help!