Copy link to clipboard
Copied
Hello, scripters and experts.
I'm having problems trying to generate GIF files using JS in Photoshop.
I set all my properties but PS just ignore my lossy = 0 and sets it to 60.
So, I'm having bad quality GIF files.
I already read about this problem, but couldn't find any solution.
Could you help me? Thanks in advance.
var myGIFname = String(app.activeDocument.fullName).replace(".mov" , ".gif");
var myExportOptions = new ExportOptionsSaveForWeb();
myExportOptions.lossy = 0;
myExportOptions.format = SaveDocumentType.COMPUSERVEGIF;
myExportOptions.colorReduction = ColorReductionType.SELECTIVE;
myExportOptions.includeProfile = false;
myExportOptions.colors = 128;
myExportOptions.dither = Dither.DIFFUSION;
myExportOptions.ditherAmount = 100;
myExportOptions.transparency = true;
myExportOptions.transparencyDither = Dither.NONE;
myExportOptions.interlaced = false;
myExportOptions.webSnap = 0;
app.activeDocument.exportDocument(File(myGIFname) , ExportType.SAVEFORWEB , myExportOptions);
That's not that code you should look for in SL. It is very long and should start from var idExpr = charIDToTypeID( "Expr" );
Copy link to clipboard
Copied
try the solution from this topic For animated gifs: gifsicle sets Photoshops SaveForWeb parameter "lossy" to 60 that cannot be change...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I tried it. But I receive an error saying "This functionality may not be available in this version of Photoshop".
I downloaded the eventListener, install it, and copy the code generated in the log.
But, as mentioned, it stops in the first executeAction method.

Copy link to clipboard
Copied
That's not that code you should look for in SL. It is very long and should start from var idExpr = charIDToTypeID( "Expr" );
Copy link to clipboard
Copied
Thank you. I'll try it!
>
Copy link to clipboard
Copied
That's it. Thank you so much!
Copy link to clipboard
Copied
Why do you need SL?
It is better to show your full code that produces an error.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more