Highlighted

JS - loading a color Lookup adjustment layer

Community Beginner ,
May 17, 2016

Copy link to clipboard

Copied

Photoshop CC2015

Hi,

Iḿ looking to create a script to load as an adjustment layer a color lookup with a loaded file...  I manage to have a the adjustment layer created by scriptListener... but it does not record the loading process.. I was expecting to change the path to my own variable....

I tried to find some infos inside of the Javascript Ref, no success.... even in the layerKind... the color Lookup does not seems to be here.

Anybody knows how I can do this or where I should focus?

Thx a lot.

Romain

Topics

Actions and scripting

Views

1.5K

Likes

Translate

Translate

Report

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

JS - loading a color Lookup adjustment layer

Community Beginner ,
May 17, 2016

Copy link to clipboard

Copied

Photoshop CC2015

Hi,

Iḿ looking to create a script to load as an adjustment layer a color lookup with a loaded file...  I manage to have a the adjustment layer created by scriptListener... but it does not record the loading process.. I was expecting to change the path to my own variable....

I tried to find some infos inside of the Javascript Ref, no success.... even in the layerKind... the color Lookup does not seems to be here.

Anybody knows how I can do this or where I should focus?

Thx a lot.

Romain

Topics

Actions and scripting

Views

1.5K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
May 17, 2016

Copy link to clipboard

Copied

If you add adjustment layers how it get added may be effected by how the user has the adjustment Panels fly-out options set Add Layer mask and clip to layer.  If set from Adobe default settings to add layer mask and not clip,  These option can cause incorrect operation. Script and Actions.  How the action and scripts that add adjustment layers works may change.  Do not change these option settings. 

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
May 18, 2016

Copy link to clipboard

Copied

Hi JJMack,

Thx for taking time to answer.. I appreciate. The thing I'm not sure to understand it. Probably I was not clear myself in my question. I would like to create an adjustment layer "color lookup" and load inside a .cube file, all done in Javascript.

I don't see how layer mask or clip to layer are coming in... unless, which is really possible, I'm missing something in your answer. Would you mind to explain it ?

Thx a lot

Romain

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
May 20, 2016

Copy link to clipboard

Copied

Any suggestions about how I can load a 3DLut inside the colorLookup adjustment layer ? Will be really appreciate.

Cheers

R.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Nov 08, 2016

Copy link to clipboard

Copied

I'm trying to do the same thing with PS CS6.

I'm using this to create the adjustment layer, which works (IDs is an Object we have setup with predefined type IDs):

function NewColorLookupLayer() 
{
      var desc0 = new ActionDescriptor();
      var ref0 = new ActionReference();
      ref0.putClass( IDs.AdjL );
      desc0.putReference( IDs.null, ref0 );
      var desc1 = new ActionDescriptor();
      desc1.putClass( IDs.Type, IDs.colorLookup );
      desc0.putObject( IDs.Usng, IDs.AdjL, desc1 );
      executeAction( IDs.Make, desc0, DialogModes.NO );
}

However, when I set the LUT, it appears to be pre-processing it into a binary blob and storing it as a "profile". Here's a cleaned-up version with ??? for the binary blob. (strCubeData is just the contents of the .cube file.)

function SetColorLut(strCubePath, strCubeData) 
{
      var desc0 = new ActionDescriptor();
      var ref0 = new ActionReference();
      ref0.putEnumerated(IDs.AdjL, IDs.Ordn, IDs.Trgt);
      desc0.putReference(IDs.null, ref0);
      var desc1 = new ActionDescriptor();
      desc1.putEnumerated(IDs.lookupType, IDs.colorLookupType, IDs.threeDLUT);
      desc1.putString(IDs.Name, strCubePath);

      desc1.putData(IDs.profile, String.fromCharCode(???)); // Binary blob with encoded LUT data

      desc1.putEnumerated(IDs.LUTFormat, IDs.LUTFormatType, IDs.LUTFormatCUBE);
      desc1.putData(IDs.LUTthreeDFileData, strCubeData);
      desc1.putString(IDs.LUTthreeDFileName, strCubePath);
      desc0.putObject(IDs.T, IDs.colorLookup, desc1);
      executeAction(IDs.Set, desc0, DialogModes.NO);
}

Parts of the binary blob are fairly easy to decode, but I'm unsure about the meaning of several parts of the data. Would it be possible to get the format for this data?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Aug 01, 2017

Copy link to clipboard

Copied

Does anybody have any more information about the binary blob data being loaded to the profile?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Aug 03, 2018

Copy link to clipboard

Copied

Did you ever manage to solve this? I am stuck at pretty much the same point at the moment. Any help would be highly appreciated

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Sep 11, 2020

Copy link to clipboard

Copied

I got to the same point, the first block of code is an icc device link profile with a Clut generated by Lut. Unfortunately I can't figure out how to generate this data. Has anyone found a solution?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...