Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

Export channels to tif in 600

Contributor ,
Oct 23, 2023 Oct 23, 2023

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.

TOPICS
Actions and scripting , Windows
422
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Oct 23, 2023 Oct 23, 2023
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 23, 2023 Oct 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 23, 2023 Oct 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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 24, 2023 Oct 24, 2023

I am getting this error... Not even chatgpt is getting it correct this time 😕

 

AntonioPacheco_0-1698166767092.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2023 Oct 24, 2023
LATEST
quote

I am getting this error... Not even chatgpt is getting it correct this time 😕

 

AntonioPacheco_0-1698166767092.png

 


By @AntonioPacheco


ChatGPT rarely gets it right.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 24, 2023 Oct 24, 2023

I also tryied as this:

doc2.resizeImage(undefined, undefined, 600, ResampleMethod.NONE);


But I cant get the size of the file exported manually, look comparisson:

AntonioPacheco_0-1698167119565.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Oct 24, 2023 Oct 24, 2023

It worked like:

doc2.resizeImage(doc2.width * 2, doc2.height * 2, 600, ResampleMethod.AUTOMATIC);
AntonioPacheco_0-1698167786513.pngAntonioPacheco_1-1698167791512.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines