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

JSX > Camera Raw Filter > Transform. Possible?

New Here ,
Jun 09, 2020 Jun 09, 2020

Copy link to clipboard

Copied

Hi,

 

i need a jsx-script which applys the camera raw filter with the transform-settings

auto perspective, only horizontal lines, only ordinal lines and horizontal+ordinal lines.

But i cant find a documentation for the camera-raw filter anywhere.

I already found out how to auto whitebalance but i still need the 4 functions of changing the perspective.

 

Can someone help me please?
Thanks a lot


Regards

Kunterbunt

TOPICS
Actions and scripting

Views

1.7K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 10, 2020 Jun 10, 2020

After some reverse engineering and testing, I have this thing:

 

 

/*
Camera Raw Filter - Transform Values:
1 = Auto, 2 = Full, 3 = Level, 4 = Vertical
*/
transformCRF( transValue = 1 );

function transformCRF() {
    var actDesc = new ActionDescriptor();
    var transCode = charIDToTypeID("PerU");
    actDesc.putInteger(transCode, transValue);
    executeAction(stringIDToTypeID("Adobe Camera Raw Filter"), actDesc, DialogModes.NO);
}

 

  

Enjoy!

Likes

Translate

Translate
Community Expert ,
Jun 09, 2020 Jun 09, 2020

Copy link to clipboard

Copied

Take a look at this topic thread:

 

 
I am not sure if the options you require are in there or not...
 
EDIT: After a quick test it appears that it may be possible to record this using ScriptingListener:
 
 

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
community guidelines
New Here ,
Jun 09, 2020 Jun 09, 2020

Copy link to clipboard

Copied

Hey, i already answered to JJMack:

JSX > Camera Raw Filter > Transform. Possible?

 

Thanks for your fast reply!

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
community guidelines
Community Expert ,
Jun 10, 2020 Jun 10, 2020

Copy link to clipboard

Copied

After some reverse engineering and testing, I have this thing:

 

 

/*
Camera Raw Filter - Transform Values:
1 = Auto, 2 = Full, 3 = Level, 4 = Vertical
*/
transformCRF( transValue = 1 );

function transformCRF() {
    var actDesc = new ActionDescriptor();
    var transCode = charIDToTypeID("PerU");
    actDesc.putInteger(transCode, transValue);
    executeAction(stringIDToTypeID("Adobe Camera Raw Filter"), actDesc, DialogModes.NO);
}

 

  

Enjoy!

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
community guidelines
Community Expert ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

So, did my script work for you?

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
community guidelines
LEGEND ,
Jun 09, 2020 Jun 09, 2020

Copy link to clipboard

Copied

you may be able to record an action to do that. I would have the action convert the layer you target to a smart object layer before applying an ACR Filter to the layer.

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
community guidelines
New Here ,
Jun 09, 2020 Jun 09, 2020

Copy link to clipboard

Copied

Hi JJMack,

the problem is, if i record it as an action it always gets the same angle when i repeated it.

if i now apply a record on a new image it has not the same output as if i would do it like i do it with hands.

 

Regards

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
community guidelines
LEGEND ,
Jun 10, 2020 Jun 10, 2020

Copy link to clipboard

Copied

In a script you would need to add something like an interactive process or some automated process to change the angle based on some criteria.  You can make an action steps like applying a filter interactive in a action so you can change the angle recorded into the step interactively.

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
community guidelines
LEGEND ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

I do not think you will be able to script an ACR Filter Auto transform perspective horizontal lines.  As far as I know the is no DOM interface for ACR.  When I use the scriptlistener plug-in to record an ACR Filter using Auto transform horizontal lines what get recordes are settings for the current image. Which may not even have horizontal lines the can be leveled.  Here I added a Smart ACR filter the a smart object layer. I captures what was recorded.   You may be able to script an interactive ACR filters step the will allow the user toe adjust the current images layer.  I made the Script listener code the seems to deal the the transform it not simple true false bit involved. Ther are settings for the images the ACR Filters was recorded on recorded.

Capture.jpg

 // =======================================================
var idAdobeCameraRawFilter = stringIDToTypeID( "Adobe Camera Raw Filter" );
var desc91 = new ActionDescriptor();
var idCMod = charIDToTypeID( "CMod" );
desc91.putString( idCMod, """Filter""" );
var idSett = charIDToTypeID( "Sett" );
var idSett = charIDToTypeID( "Sett" );
var idCst = charIDToTypeID( "Cst " );
desc91.putEnumerated( idSett, idSett, idCst );
var idWBal = charIDToTypeID( "WBal" );
var idWBal = charIDToTypeID( "WBal" );
var idAsSh = charIDToTypeID( "AsSh" );
desc91.putEnumerated( idWBal, idWBal, idAsSh );
var idTemp = charIDToTypeID( "Temp" );
desc91.putInteger( idTemp, 0 );
var idTint = charIDToTypeID( "Tint" );
desc91.putInteger( idTint, 0 );
var idCtoG = charIDToTypeID( "CtoG" );
desc91.putBoolean( idCtoG, false );
var idStrt = charIDToTypeID( "Strt" );
desc91.putInteger( idStrt, 0 );
var idShrp = charIDToTypeID( "Shrp" );
desc91.putInteger( idShrp, 0 );
var idLNR = charIDToTypeID( "LNR " );
desc91.putInteger( idLNR, 0 );
var idCNR = charIDToTypeID( "CNR " );
desc91.putInteger( idCNR, 0 );
var idVigA = charIDToTypeID( "VigA" );
desc91.putInteger( idVigA, 0 );
var idBlkB = charIDToTypeID( "BlkB" );
desc91.putInteger( idBlkB, 0 );
var idRHue = charIDToTypeID( "RHue" );
desc91.putInteger( idRHue, 0 );
var idRSat = charIDToTypeID( "RSat" );
desc91.putInteger( idRSat, 0 );
var idGHue = charIDToTypeID( "GHue" );
desc91.putInteger( idGHue, 0 );
var idGSat = charIDToTypeID( "GSat" );
desc91.putInteger( idGSat, 0 );
var idBHue = charIDToTypeID( "BHue" );
desc91.putInteger( idBHue, 0 );
var idBSat = charIDToTypeID( "BSat" );
desc91.putInteger( idBSat, 0 );
var idVibr = charIDToTypeID( "Vibr" );
desc91.putInteger( idVibr, 0 );
var idHA_R = charIDToTypeID( "HA_R" );
desc91.putInteger( idHA_R, 0 );
var idHA_O = charIDToTypeID( "HA_O" );
desc91.putInteger( idHA_O, 0 );
var idHA_Y = charIDToTypeID( "HA_Y" );
desc91.putInteger( idHA_Y, 0 );
var idHA_G = charIDToTypeID( "HA_G" );
desc91.putInteger( idHA_G, 0 );
var idHA_A = charIDToTypeID( "HA_A" );
desc91.putInteger( idHA_A, 0 );
var idHA_B = charIDToTypeID( "HA_B" );
desc91.putInteger( idHA_B, 0 );
var idHA_P = charIDToTypeID( "HA_P" );
desc91.putInteger( idHA_P, 0 );
var idHA_M = charIDToTypeID( "HA_M" );
desc91.putInteger( idHA_M, 0 );
var idSA_R = charIDToTypeID( "SA_R" );
desc91.putInteger( idSA_R, 0 );
var idSA_O = charIDToTypeID( "SA_O" );
desc91.putInteger( idSA_O, 0 );
var idSA_Y = charIDToTypeID( "SA_Y" );
desc91.putInteger( idSA_Y, 0 );
var idSA_G = charIDToTypeID( "SA_G" );
desc91.putInteger( idSA_G, 0 );
var idSA_A = charIDToTypeID( "SA_A" );
desc91.putInteger( idSA_A, 0 );
var idSA_B = charIDToTypeID( "SA_B" );
desc91.putInteger( idSA_B, 0 );
var idSA_P = charIDToTypeID( "SA_P" );
desc91.putInteger( idSA_P, 0 );
var idSA_M = charIDToTypeID( "SA_M" );
desc91.putInteger( idSA_M, 0 );
var idLA_R = charIDToTypeID( "LA_R" );
desc91.putInteger( idLA_R, 0 );
var idLA_O = charIDToTypeID( "LA_O" );
desc91.putInteger( idLA_O, 0 );
var idLA_Y = charIDToTypeID( "LA_Y" );
desc91.putInteger( idLA_Y, 0 );
var idLA_G = charIDToTypeID( "LA_G" );
desc91.putInteger( idLA_G, 0 );
var idLA_A = charIDToTypeID( "LA_A" );
desc91.putInteger( idLA_A, 0 );
var idLA_B = charIDToTypeID( "LA_B" );
desc91.putInteger( idLA_B, 0 );
var idLA_P = charIDToTypeID( "LA_P" );
desc91.putInteger( idLA_P, 0 );
var idLA_M = charIDToTypeID( "LA_M" );
desc91.putInteger( idLA_M, 0 );
var idSTSH = charIDToTypeID( "STSH" );
desc91.putInteger( idSTSH, 0 );
var idSTSS = charIDToTypeID( "STSS" );
desc91.putInteger( idSTSS, 0 );
var idSTHH = charIDToTypeID( "STHH" );
desc91.putInteger( idSTHH, 0 );
var idSTHS = charIDToTypeID( "STHS" );
desc91.putInteger( idSTHS, 0 );
var idSTB = charIDToTypeID( "STB " );
desc91.putInteger( idSTB, 0 );
var idPC_S = charIDToTypeID( "PC_S" );
desc91.putInteger( idPC_S, 0 );
var idPC_D = charIDToTypeID( "PC_D" );
desc91.putInteger( idPC_D, 0 );
var idPC_L = charIDToTypeID( "PC_L" );
desc91.putInteger( idPC_L, 0 );
var idPC_H = charIDToTypeID( "PC_H" );
desc91.putInteger( idPC_H, 0 );
var idPC_one = charIDToTypeID( "PC_1" );
desc91.putInteger( idPC_one, 25 );
var idPC_two = charIDToTypeID( "PC_2" );
desc91.putInteger( idPC_two, 50 );
var idPC_three = charIDToTypeID( "PC_3" );
desc91.putInteger( idPC_three, 75 );
var idShpR = charIDToTypeID( "ShpR" );
desc91.putDouble( idShpR, 1.000000 );
var idShpD = charIDToTypeID( "ShpD" );
desc91.putInteger( idShpD, 25 );
var idShpM = charIDToTypeID( "ShpM" );
desc91.putInteger( idShpM, 0 );
var idPCVA = charIDToTypeID( "PCVA" );
desc91.putInteger( idPCVA, 0 );
var idGRNA = charIDToTypeID( "GRNA" );
desc91.putInteger( idGRNA, 0 );
var idLPEn = charIDToTypeID( "LPEn" );
desc91.putInteger( idLPEn, 0 );
var idMDis = charIDToTypeID( "MDis" );
desc91.putInteger( idMDis, 0 );
var idPerV = charIDToTypeID( "PerV" );
desc91.putInteger( idPerV, 0 );
var idPerH = charIDToTypeID( "PerH" );
desc91.putInteger( idPerH, 0 );
var idPerR = charIDToTypeID( "PerR" );
desc91.putDouble( idPerR, 0.000000 );
var idPerS = charIDToTypeID( "PerS" );
desc91.putInteger( idPerS, 100 );
var idPerA = charIDToTypeID( "PerA" );
desc91.putInteger( idPerA, 0 );
var idPerU = charIDToTypeID( "PerU" );
desc91.putInteger( idPerU, 3 );
var idPerX = charIDToTypeID( "PerX" );
desc91.putDouble( idPerX, 0.000000 );
var idPerY = charIDToTypeID( "PerY" );
desc91.putDouble( idPerY, 0.000000 );
var idAuCA = charIDToTypeID( "AuCA" );
desc91.putInteger( idAuCA, 0 );
var idExonetwo = charIDToTypeID( "Ex12" );
desc91.putDouble( idExonetwo, 0.000000 );
var idCronetwo = charIDToTypeID( "Cr12" );
desc91.putInteger( idCronetwo, 0 );
var idHionetwo = charIDToTypeID( "Hi12" );
desc91.putInteger( idHionetwo, 0 );
var idShonetwo = charIDToTypeID( "Sh12" );
desc91.putInteger( idShonetwo, 0 );
var idWhonetwo = charIDToTypeID( "Wh12" );
desc91.putInteger( idWhonetwo, 0 );
var idBkonetwo = charIDToTypeID( "Bk12" );
desc91.putInteger( idBkonetwo, 0 );
var idClonetwo = charIDToTypeID( "Cl12" );
desc91.putInteger( idClonetwo, 0 );
var idDfPA = charIDToTypeID( "DfPA" );
desc91.putInteger( idDfPA, 0 );
var idDPHL = charIDToTypeID( "DPHL" );
desc91.putInteger( idDPHL, 30 );
var idDPHH = charIDToTypeID( "DPHH" );
desc91.putInteger( idDPHH, 70 );
var idDfGA = charIDToTypeID( "DfGA" );
desc91.putInteger( idDfGA, 0 );
var idDPGL = charIDToTypeID( "DPGL" );
desc91.putInteger( idDPGL, 40 );
var idDPGH = charIDToTypeID( "DPGH" );
desc91.putInteger( idDPGH, 60 );
var idDhze = charIDToTypeID( "Dhze" );
desc91.putInteger( idDhze, 0 );
var idCrTx = charIDToTypeID( "CrTx" );
desc91.putInteger( idCrTx, 0 );
var idTMMs = charIDToTypeID( "TMMs" );
desc91.putInteger( idTMMs, 0 );
var idCrv = charIDToTypeID( "Crv " );
var list19 = new ActionList();
list19.putInteger( 0 );
list19.putInteger( 0 );
list19.putInteger( 255 );
list19.putInteger( 255 );
desc91.putList( idCrv, list19 );
var idCrvR = charIDToTypeID( "CrvR" );
var list20 = new ActionList();
list20.putInteger( 0 );
list20.putInteger( 0 );
list20.putInteger( 255 );
list20.putInteger( 255 );
desc91.putList( idCrvR, list20 );
var idCrvG = charIDToTypeID( "CrvG" );
var list21 = new ActionList();
list21.putInteger( 0 );
list21.putInteger( 0 );
list21.putInteger( 255 );
list21.putInteger( 255 );
desc91.putList( idCrvG, list21 );
var idCrvB = charIDToTypeID( "CrvB" );
var list22 = new ActionList();
list22.putInteger( 0 );
list22.putInteger( 0 );
list22.putInteger( 255 );
list22.putInteger( 255 );
desc91.putList( idCrvB, list22 );
var idCamP = charIDToTypeID( "CamP" );
desc91.putString( idCamP, """Embedded""" );
var idCP_D = charIDToTypeID( "CP_D" );
desc91.putString( idCP_D, """54650A341B5B5CCAE8442D0B43A92BCE""" );
var idPrVe = charIDToTypeID( "PrVe" );
desc91.putInteger( idPrVe, 184549376 );
var idRtch = charIDToTypeID( "Rtch" );
desc91.putString( idRtch, """""" );
var idREye = charIDToTypeID( "REye" );
desc91.putString( idREye, """""" );
var idLCs = charIDToTypeID( "LCs " );
desc91.putString( idLCs, """""" );
var idUpri = charIDToTypeID( "Upri" );
desc91.putString( idUpri, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
crs:UprightVersion="151388160"
crs:UprightCenterMode="0"
crs:UprightCenterNormX="0.462738862"
crs:UprightCenterNormY="0.532718776"
crs:UprightFocalMode="0"
crs:UprightFocalLength35mm="24.788742817"
crs:UprightPreview="False"
crs:UprightDependentDigest="F7173540FD9FB419BD947A976070F4D2"
crs:UprightTransformCount="6"
crs:UprightTransform_0="1.000000000,0.000000000,0.000000000,0.000000000,1.000000000,0.000000000,0.000000000,0.000000000,1.000000000"
crs:UprightTransform_1="0.808961240,0.377906143,-0.107459435,-0.185614526,0.806268294,0.170092651,-0.025575768,-0.023639054,1.000000000"
crs:UprightTransform_2="0.818385545,0.509386736,-0.360791421,-0.649008607,1.070503790,0.265170142,-0.498072658,0.335673931,1.000000000"
crs:UprightTransform_3="0.953456223,0.452297213,-0.202876718,-0.201020984,0.953456223,0.123782381,0.000000000,0.000000000,1.000000000"
crs:UprightTransform_4="1.233995887,0.859766166,-0.433192021,-0.225977462,1.996436183,0.011831504,-0.022680080,0.804970305,1.000000000"
crs:UprightTransform_5="1.000000000,0.000000000,0.000000000,0.000000000,1.000000000,0.000000000,0.000000000,0.000000000,1.000000000"/>
</rdf:RDF>
</x:xmpmeta>
""" );
var idGuUr = charIDToTypeID( "GuUr" );
desc91.putString( idGuUr, """<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c140 79.160451, 2017/05/06-01:08:21 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/"
crs:UprightFourSegmentsCount="0"/>
</rdf:RDF>
</x:xmpmeta>
""" );
var idLook = charIDToTypeID( "Look" );
desc91.putString( idLook, """""" );
var idPset = charIDToTypeID( "Pset" );
desc91.putString( idPset, """""" );
executeAction( idAdobeCameraRawFilter, desc91, DialogModes.NO );

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
community guidelines
LEGEND ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

His script produces the same results so Stephen reverse engineering may work for you  be sure to set the value to 3. How he found it is "PerU" that needs to be set is beyond me know how.

 

/*
Camera Raw Filter - Transform Values:
1 = Auto, 2 = Full, 3 = Level, 4 = Vertical
*/
transformCRF( transValue = 3 );

function transformCRF() {
var actDesc = new ActionDescriptor();
var transCode = charIDToTypeID("PerU");
actDesc.putInteger(transCode, transValue);
executeAction(stringIDToTypeID("Adobe Camera Raw Filter"), actDesc, DialogModes.NO);
}

image.png

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
community guidelines
Community Expert ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

LATEST

 

How he found it is "PerU" that needs to be set is beyond me know how.

 

 

Hi JJMack, it just took time and perseverance!

 

As this is undocumented, it meant trial and error, comparing the ScriptingListener code for a file with and without the Camera Raw Filter Transforms applied. Once I found that the charIDToTypeID("PerU") was the answer, I then needed to find what the parameters were, which again was a case of comparing all four options and see where the differences in code were:

 

1 = Auto
2 = Full
3 = Level (Horizontal)
4 = Vertical

 

 

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
community guidelines