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

Want to merge 4 CMYK plates as TIFFs into one CMYK final

New Here ,
Oct 14, 2015 Oct 14, 2015

I have a project wherein I am attempting to take 4 individual plates of an image that are separated by a RIP and saved as TIFF files in a folder.

I have a resultant folder full of 4 separate TIFF files, each with a unique name as a plate identifier.

Merging the individual plates that are already individual CHANNELS of a PSD file is easy of course, but I am looking to build an Action script that will automate the process without the manual script replicating every-move being replicated, and using inefficient things like "copy" and "paste" to assemble a new document from the 4 source files.

For example..  to do so as a human, I might open each of the four files, in order... take the cyan plate, select all, copy, make a new CMYK document with the clipboard and paste the tiff file as a cyan "channel" plate in the new CMYK file. Repeating the process until I have all 4-plates assembled into one CMYK PSD file. These are really large files... gigabytes per 8-bit plate.... so copy and paste is.. awkward at best.

What I would like to do however is to automate the process by having photoshop merge a folder of 4, properly-named 8-bit grey tiff files (eg: 1_C_plate.tiff, 2_M_plate.tiff, 3_Y_plate.tiff, 4_k_plate.tiff) into the CHANNELS of a new document.

Is there a way to automate the process of leading the channels of a blank or new PSD file with the contents of a folder if the directory structure is restrictive enough to always know of the format of a filename?

Any guidance would be of help.. I am only finding the ability so far to merge channels not individual files without the explicit script to open them, copy them, move to new document and paste them, etc..

My eventual goal would be to have a droplet for example that would take the source folder of 4 files, and assemble them as described, and save a PSD file in the local directory of the files.

Am I just missing a feature that spans the channels of a document OUTSIDE the structure of a document as 4 separate (or 3 in the case of RGB) channels as individual files?

Many thanks in advance! I've tried pretty hard to get this before asking for "directions" so to speak (grin)

Chris

TOPICS
Actions and scripting
2.3K
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 25, 2015 Oct 25, 2015

Chris, doing this in a RIP or via PDF workflow software would be preferred over Photoshop, have you explored this option?

Another productive method would be using Enfocus Switch.

You mention “Action script”, which are two different things. As you have posted in the scripting forum, can I presume that you are looking for a true script and not an action/macro?

Can you provide real examples of the file names for two different jobs? Or do you mean that even if the original job name is unique, the separated files are always the same exact names saved into different named output locations?

Depending on the above, this may or may not be easily accomplished via an action rather than a script…

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 25, 2015 Oct 25, 2015

Chris, if using an action, I would use the channels/merge channels command rather than copy/paste etc.

The main issue is that an action will record the explicit file names used for the channels, so actions can be very limited when one is dealing with variable names. One viable work around could be to dupe/rename/close the original file names to a standard fixed name that would be used to merge the channels via an action. I have made this work via an action on a single set of four opened files, however I am not sure if this could work via a batch action on multiples sets.

I can’t get the following script to work, however somebody else may be able to find out why there are errors (I am using CS6, also tried in CS5):

https://gist.github.com/moluapple/1333451

PS_Merge Multiple Single-Channel-Files to One Multi-Channels File

(function (){

var f = Folder.selectDialog ('选择文件夹'),

fA = f.getFiles ('*.tif'),

fs = f.fsName,

op = new TiffSaveOptions,

i = 0;

op.imageCompression = TIFFEncoding.TIFFLZW; // 设置LZW压缩

for (; i < fA.length; i += 5){

process (fA);

}

function process (base) {

var fn = base.name.split('_')[0],

PMS = unescape(f.getFiles (fn + '*.tif').toString().match(/(Pantone.+?)\.tif/)[1]),

F = function (str){return File(fs + '/' + fn + '_' + str +'.tif')},

_C = F('Cyan'),

_M = F('Magenta'),

_Y = F('Yellow'),

_K = F('Black'),

_S = F(PMS),

loop = [_M, _Y, _K, _S],

mDoc = app.open(_C),

i = 0,

doc;

mDoc.changeMode(ChangeMode.MULTICHANNEL);

for (; i < 4; i++){

doc = app.open(loop);

doc.channels[0].duplicate (mDoc);

doc.close(SaveOptions.DONOTSAVECHANGES);

}

mDoc.channels[4].name = PMS.toUpperCase();

mDoc.channels[4].kind = ChannelType.SPOTCOLOR;

setPMSColor(PMS);

mDoc.changeMode(ChangeMode.CMYK);

mDoc.saveAs(F('合并'), op);

mDoc.close(SaveOptions.DONOTSAVECHANGES);

}

// ScriptingListenerJS Code

function setPMSColor(str) {

var idsetd = charIDToTypeID("setd");

var desc20 = new ActionDescriptor();

var idnull = charIDToTypeID("null");

var ref12 = new ActionReference();

var idChnl = charIDToTypeID("Chnl");

var idOrdn = charIDToTypeID("Ordn");

var idTrgt = charIDToTypeID("Trgt");

ref12.putEnumerated(idChnl, idOrdn, idTrgt);

desc20.putReference(idnull, ref12);

var idT = charIDToTypeID("T ");

var desc21 = new ActionDescriptor();

var idClr = charIDToTypeID("Clr ");

var desc22 = new ActionDescriptor();

var idBk = charIDToTypeID("Bk ");

desc22.putString(idBk, "PANTONE? solid coated");

var idNm = charIDToTypeID("Nm ");

desc22.putString(idNm, str);

var idbookID = stringIDToTypeID("bookID");

desc22.putInteger(idbookID, 3002);

var idbookKey = stringIDToTypeID("bookKey");

desc22.putData(idbookKey, ' ' + str.replace(/\s/g, '').replace(/pantone/i, ''));

var idBkCl = charIDToTypeID("BkCl");

desc21.putObject(idClr, idBkCl, desc22);

var idSCch = charIDToTypeID("SCch");

desc20.putObject(idT, idSCch, desc21);

executeAction(idsetd, desc20, DialogModes.NO);

}

})();

This script appears to be merging channels to multichannel mode and assigning a CMYK spot colour to each separation and possibly a 5th plate spot colour. In your case this is just a direct merge to CMYK mode rather than multichannel.

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 25, 2015 Oct 25, 2015

I previously mentioned Enfocus Switch to help automate this process, such a workflow would make use of the Command Line Utility (CLI) “ImageMagick” (this is not a cheap or out of the box solution, even though ImageMagick is open source).

Of course, one does not need Switch to use ImageMagick and this CLI could potentially be automated using other methods.

Here is the page on combining channels from the ImageMagick site:

http://www.imagemagick.org/Usage/color_basics/#combine_other

http://imagemagick.org

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
New Here ,
Feb 07, 2016 Feb 07, 2016

I use Switch and thanks for the thoughts on IMagemagick. I have used it in the past.

I am kind if needing to use Photoshop for this as it is a required Windows platform (Imagemagick is Mac/Unix only) and these are some pretty large files. Massive.

I'm still working on this..   I think I can use Regular Expressions to parse a filename for a specific characteristic that designates which plate it should go onto.

I'm not giving up and thanks for your help. 😉

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 ,
Feb 08, 2016 Feb 08, 2016
LATEST

There is also the GraphicsMagick offshoot, that is Windows compatible:

GraphicsMagick Download

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