Copy link to clipboard
Copied
Hi! I am trying to export channels into tif at 600, but the final resolution is always 300 and I am not sure why, I manually exported the channels and in fact the tif are in 600 (they are like 19mb in 300 and around 72mb in 60).
Here is the code:
function Split600() {
var outputFolder = new Folder("~/Downloads/nuevo");
if (!outputFolder.exists) {
outputFolder.create();
}
var channelsSplit = confirm("Have you already split the channels for the documents you want to export as TIFF?", "Channels Split Confirmation");
if (channelsSplit) {
var allDocuments = [];
for (var i = 0; i < app.documents.length; i++) {
allDocuments.push(app.documents[i]);
}
for (var i = 0; i < allDocuments.length; i++) {
var doc = allDocuments[i];
app.activeDocument = allDocuments[i];
var fileName = doc.name.replace(/\.[^\.]+$/, '') + ".tif";
var filePath = new File(outputFolder + "/" + fileName);
var tiffOptions = new TiffSaveOptions();
tiffOptions.layers = true;
tiffOptions.alphaChannels = true;
tiffOptions.imageCompression = TIFFEncoding.NONE; // Set the compression to "None" (uncompressed)
tiffOptions.resolution = 600; // Set the resolution to 600 DPI
tiffOptions.byteOrder = ByteOrder.MACOS;
doc.saveAs(filePath, tiffOptions, true);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
// alert("Uncompressed TIFF export completed for all open documents at 300 DPI!");
} else {
// alert("No action taken. Please split the channels and run the script again.");
var documents = app.documents;
var doc = documents[0];
doc.splitChannels();
var allDocuments = [];
for (var i = 0; i < app.documents.length; i++) {
allDocuments.push(app.documents[i]);
}
for (var i = 0; i < allDocuments.length; i++) {
var doc = allDocuments[i];
app.activeDocument = allDocuments[i];
var fileName = doc.name.replace(/\.[^\.]+$/, '') + ".tif";
var filePath = new File(outputFolder + "/" + fileName);
var tiffOptions = new TiffSaveOptions();
tiffOptions.layers = true;
tiffOptions.alphaChannels = true;
tiffOptions.imageCompression = TIFFEncoding.NONE; // Set the compression to "None" (uncompressed)
tiffOptions.resolution = 600; // Set the resolution to 600 DPI
tiffOptions.byteOrder = ByteOrder.MACOS;
doc.saveAs(filePath, tiffOptions, true);
doc.close(SaveOptions.DONOTSAVECHANGES);
}
}
}
Split600();
First I ask if the channels are splitted, if not, I split them and then export tab by tab, but nothing happens, it exports to a fodler in downloads named "Nuevo", I'll appreciate some help.
Copy link to clipboard
Copied
@AntonioPacheco – There is no .resolution property for TiffSaveOptions:
https://theiviaxx.github.io/photoshop-docs/Photoshop/TiffSaveOptions.html?highlight=resolution
Copy link to clipboard
Copied
Ohhh didn't know that... Well it was also the first time I use 600 resolution, would there be a way to workaround?
Copy link to clipboard
Copied
Before splitting, you will need to resize the image to 600ppi.
If the document was 2x2" at 300ppi, then with resampling of NONE at 600ppi, the document would be 1x1"... Otherwise with resampling you could maintain the 2x2" size at 600ppi.
https://theiviaxx.github.io/photoshop-docs/Photoshop/Document/resizeImage.html?highlight=resizeimage
Copy link to clipboard
Copied
I am getting this error... Not even chatgpt is getting it correct this time 😕
Copy link to clipboard
Copied
I am getting this error... Not even chatgpt is getting it correct this time 😕
By @AntonioPacheco
ChatGPT rarely gets it right.
Copy link to clipboard
Copied
I also tryied as this:
But I cant get the size of the file exported manually, look comparisson:
Copy link to clipboard
Copied
It worked like:
Find more inspiration, events, and resources on the new Adobe Community
Explore Now