Skip to main content
Inspiring
October 23, 2023
Question

Export channels to tif in 600

  • October 23, 2023
  • 1 reply
  • 432 views

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.

This topic has been closed for replies.

1 reply

Stephen Marsh
Community Expert
Community Expert
October 23, 2023
Inspiring
October 23, 2023

Ohhh didn't know that... Well it was also the first time I use 600 resolution, would there be a way to workaround?

Stephen Marsh
Community Expert
Community Expert
October 23, 2023

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