Copy link to clipboard
Copied
Scenario:
I'm trying to make a time lapse video.
I have a finished (only one file, so no batching) drawing/painting file with many layers. I made all the layers invisible. Then, I started at my background layers and enabled the visibility of a particular layer, changed the opacity of that one layer to, lets say 25%, and saved the image as a jpeg file named "1" (however, png would be better now that I think about it). Then, I went back to the same layer, changed the opacity to 50% and saved a jpeg file as "2"........ I made it to 250 images and I cannot afford to keep going this way.
Is there a script that could save the images and add a sequential name as in the example, after I have manually modified the opacity of the layer?
I found this unique name command but is either not doing it or is saving the images in some random place.
function CreateUniqueFileName( inFolder, inFileName, inExtension ) {
inFileName = inFileName.replace(/[:\/\\*\?\"\<\>\|]/g, "_"); // '/\:*?"<>|' -> '_'
var uniqueFileName = inFolder + inFileName + inExtension;
var fileNumber = 1;
while ( File( uniqueFileName ).exists ) {
uniqueFileName = inFolder + inFileName + "_" + fileNumber + inExtension;
fileNumber++;
}
return uniqueFileName;
}
I also found this code, which works but the image gets overwritten every time.
var doc = app.activeDocument;
var Path = doc.path;
var Name = doc.name.replace(/\.[^\.]+$/, '');
var Suffix = "-Copy";
var saveFile = File(Path + "/" + Name + Suffix + ".jpg");
SaveJPEG(saveFile, 8);
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);
}
I wish there was something easy like (see red words):
var doc = app.activeDocument;
var Path = doc.path;
var Name = doc.name.replace(/\.[^\.]+$/, '');
var Suffix = "i";
var i=1;
var saveFile = File(Path + "/" + Name + (Suffix+1) + ".jpg");
SaveJPEG(saveFile, 8);
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions, true,Extension.LOWERCASE);
}
I would appreciate any help. Saving: choosing the quality and renaming is taking too long. I like having the control over the opacity but I want to make the saving process faster and only focus on the opacity/transitions.
Thanks!
Copy link to clipboard
Copied
For batch processing that can use sequential naming you could use Picture Processor, it can be downloaded from
Copy link to clipboard
Copied
This is an amazing tool that I will definitely use when processing many pictures, however, and as stated in my "Scenario", I only have one file that I want to save (hopefully by pressing one button) over and over again, after a small modification.
I'm trying to change opacity of one layer, and save. Next layer, change opacity, save. And I want to do this until my drawing is completed and I want to keep all the files since the modification to the first layer.
I DO NOT NEED A BATCH PROCESSING TOOL - I just need to save a file multiple times, after small adjustments and keep each saved file with a different name (so that it does not overwrites it).
Here is a sample of what I am working on: Brain Damage Lapse - YouTube
Thanks!