problem with look up table

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

svumme
Posts: 6
Joined: Sat Nov 23, 2019 11:36 pm

problem with look up table

Post by svumme »

I am trying to import some lut (color look up) through scripts, but for now without success.
I tried to examine the listener and realized that the code for the lut is split into two blocks of charcode.
I can't post all the lut code because it is very long,
however place a piece of the first block below.
/------------------------------------------------------------------------------------------------------------------
var idcolorLookup = stringIDToTypeID( "colorLookup" );
var desc17 = new ActionDescriptor();
var idlookupType = stringIDToTypeID( "lookupType" );
var idcolorLookupType = stringIDToTypeID( "colorLookupType" );
var idthreeDLUT = stringIDToTypeID( "3DLUT" );
desc17.putEnumerated( idlookupType, idcolorLookupType, idthreeDLUT );
var idNm = charIDToTypeID( "Nm " );
desc17.putString( idNm, """C:\Users\svumme\Downloads\lut\lut1.CUBE""" );
var idDthr = charIDToTypeID( "Dthr" );
desc17.putBoolean( idDthr, true );
var idprofile = stringIDToTypeID( "profile" );
desc17.putData( idprofile, String.fromCharCode( 0, 3, 2, 212, 65, 68, 66, 69, 4, 0, 0, 0, 108, 105, 110, 107, 82, 71, 66, 32, 82, 71, 66, 32, 7, 228, 0, 9, 0, 9, 0, 16,
0, 31, 0, 45, 97, 99, 115, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 246, 214, 0, 1, 0, 0, 0, 0, 211, 45, 65, 68, 66, 69, 188, 95, 63, 172, 2, 150, 199, 62, 245, 113, 66, 224,
199, 156, 246, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 4, 100, 101, 115, 99, 0, 0, 0, 180, 0, 0, 0, 48, 99, 112, 114, 116, 0, 0, 0, 228, 0, 0, 0, 110, 112, 115, 101, 113,
0, 0, 1, 84, 0, 0, 0, 116, 65, 50, 66, 48, 0, 0, 1, 200, 0, 3, 1, 12, 109, 108, 117, 99, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 12, 101, 110, 85, 83, 0, 0, 0, 20, 0, 0, 0, 28, 0, 108, 0, 117, 0, 116, 0, 49, 0, 46, 0, 67, 0, 85, 0, 66,
0, 69, 0, 0, 109, 108, 117, 99, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 101, 110, 85, 83, 0, 0, 0, 82, 0, 0, 0, 28,
0, 67, 0, 111, 0, 112, 0, 121, 0, 114, 0, 105, 0, 103, 0, 104, 0, 116, 0, 32, 0, 50, 0, 48, 0, 50, 0, 48, 0, 32, 0, 65,
0, 100, 0, 111, 0, 98, 0, 101, 0, 32, 0, 83, 0, 121, 0, 115, 0, 116, 0, 101, 0, 109, 0, 115, 0, 32, 0, 73, 0, 110, 0, 99,
0, 111, 0, 114, 0, 112, 0, 111, 0, 114, 0, 97, 0, 116, 0, 101, 0, 100, 0, 0, 112, 115, 101, 113, 0, 0, 0, 0, 0, 0, 0, 2,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 108, 117, 99, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 12, 109, 108, 117, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 109, 108, 117, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 109, 108, 117, 99, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 12, 109, 65, 66, 32, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 32, 0, 0, 0, 68, 0, 0, 0, 116,
0, 0, 0, 152, 0, 3, 0, 172, 99, 117, 114, 118, 0, 0, 0, 0, 0, 0, 0, 0, 99, 117, 114, 118, 0, 0, 0, 0, 0, 0, 0, 0,
99, 117, 114, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 117, 114, 118,
0, 0, 0, 0, 0, 0, 0, 0, 99, 117, 114, 118, 0, 0, 0, 0, 0, 0, 0, 0, 99, 117, 114, 118, 0, 0, 0, 0, 0, 0, 0, 0,
32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 164,
0, 0, 0, 0, 4, 140, 0, 0, 0, 0, 8, 66, 0, 0, 0, 0, 12, 154, 0, 0, 0, 0, 17, 126, 0, 0, 0, 0, 22, 224, 0, 0,
0, 0, 28, 178, 0, 0, 0, 0, 34, 236, 0, 0, 0, 0, 41, 136, 0, 0, 0, 0, 48, 126, 0, 0, 0, 0, 55, 202, 0, 0, 0, 0,
63, 102, 0, 0, 0, 0, 71, 82, 0, 0, 0, 0, 79, 136, 0, 0, 0, 0, 88, 6, 0, 0, 0, 0, 96, 202, 0, 0, 0, 0, 105, 210,
0, 0, 0, 0, 115, 24, 0, 0, 0, 0, 124, 159, 0, 0, 0, 0, 134, 97, 0, 0, 0, 0, 144, 97, 0, 0, 0, 0, 154, 155, 0, 0,
0, 0, 165, 11, 0, 0, 0, 0, 175, 179, 0, 0, 0, 0, 186, 147, 0, 0, 0, 0, 197, 167, 0, 0, 0, 0, 208, 239, 0, 0, 0, 0,
220, 105, 0, 0, 0, 0, 232, 21, 0, 0, 0, 0, 243, 243, 0, 0, 0, 0, 255, 255, 0, 0, 4, 130, 0, 0, 0, 0, 4, 130, 1, 164,
0, 0, 4, 130, 4, 140, 0, 0, 4, 130, 8, 66, 0, 0, 4, 130, 12, 154, 0, 0, 4, 130, 17, 126, 0, 0, 4, 130, 22, 224, 0, 0,
4, 130, 28, 178, 0, 0, 4, 130, 34, 236, 0, 0, 4, 130, 41, 136, 0, 0, 4, 130, 48, 126, 0, 0, 4, 130, 55, 202, 0, 0, 4, 130,
63, 102, 0, 0, 4, 130, 71, 82, 0, 0, 4, 130, 79, 136, 0, 0, 4, 130, 88, 6, 0, 0, 4, 130, 96, 202, 0, 0, 4, 130, 105, 210,
0, 0, 4, 130, 115, 24, 0, 0, 4, 130, 124, 159, 0, 0, 4, 130, 134, 97, 0, 0, 4, 130, 144, 97, 0, 0, 4, 130, 154, 155, 0, 0,
4, 130, 165, 11, 0, 0, 4, 130, 175, 179, 0, 0, 4, 130, 186, 147, 0, 0, 4, 130, 197, 167, 0, 0, 4, 130, 208, 239, 0, 0, 4, 130,
220, 105, 0, 0, 4, 130, 232, 21, 0, 0, 4, 130, 243, 243, 0, 0, 4, 130, 255, 255, 0, 0, 10, 48, 0, 0, 0, 0, 10, 48, 1, 164,
0, 0, 10, 48, 4, 140, 0, 0, 10, 48, 8, 66, 0, 0, 10, 48, 12, 154, 0, 0, 10, 48, 17, 126, 0, 0, 10, 48, 22, 224, 0, 0,
etc etc

converting the first block into charcode I get special characters.Image
while the second block gives me the lut code therefore it is easily understood.

is there anyone who has already had experience with color lookups and can you help me? I would like to be able to generate lut from my panel (and on this I think I can) but then send them as a layer in photoshop (this is my problem)
Attachments
lut3.JPG
lut3.JPG (330.13 KiB) Viewed 5400 times
Last edited by svumme on Tue Sep 15, 2020 1:13 am, edited 1 time in total.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: problem with look up table

Post by txuku »

Bonjour

I am French and I do not know what this "read"
I have often used this function offeryte par Mike Hale- viewtopic.php?p=41984#p41984 :

function selectColorRange (scObj)
{
var desc = new ActionDescriptor ();
desc.putInteger (charIDToTypeID ("Fzns"), 0);
var cDesc = new ActionDescriptor ();
cDesc.putDouble (charIDToTypeID ("Rd"), scObj.rgb.red);
cDesc.putDouble (charIDToTypeID ("Grn"), scObj.rgb.green);
cDesc.putDouble (charIDToTypeID ("Bl"), scObj.rgb.blue);
desc.putObject (charIDToTypeID ("Mnm"), charIDToTypeID ("RGBC"), cDesc);
desc.putObject (charIDToTypeID ("Mxm"), charIDToTypeID ("RGBC"), cDesc);
executeAction (charIDToTypeID ("ClrR"), desc, DialogModes.NO);
}

and I appreciate the results rgb or hexvalue ......
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: problem with look up table

Post by txuku »

Bonjour

I am French and I do not know what this "LUT"
I have often used this function offeryte par Mike Hale :

function selectColorRange (scObj)
{
var desc = new ActionDescriptor ();
desc.putInteger (charIDToTypeID ("Fzns"), 0);
var cDesc = new ActionDescriptor ();
cDesc.putDouble (charIDToTypeID ("Rd"), scObj.rgb.red);
cDesc.putDouble (charIDToTypeID ("Grn"), scObj.rgb.green);
cDesc.putDouble (charIDToTypeID ("Bl"), scObj.rgb.blue);
desc.putObject (charIDToTypeID ("Mnm"), charIDToTypeID ("RGBC"), cDesc);
desc.putObject (charIDToTypeID ("Mxm"), charIDToTypeID ("RGBC"), cDesc);
executeAction (charIDToTypeID ("ClrR"), desc, DialogModes.NO);
}

and I appreciate the results rgb or hexvalue ......
svumme
Posts: 6
Joined: Sat Nov 23, 2019 11:36 pm

Re: problem with look up table

Post by svumme »

thanks for the answer, but unfortunately what I'm trying to do is another thing.
I would like to import Lut (look up table). https://www.photoshopessentials.com/pho ... ain%20look.
svumme
Posts: 6
Joined: Sat Nov 23, 2019 11:36 pm

Re: problem with look up table

Post by svumme »

Last edited by svumme on Tue Sep 15, 2020 1:16 am, edited 4 times in total.
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: problem with look up table

Post by txuku »

Hum............

It's a bit complicated for me ! :oops: