powerful_Zephyr5EF9
Explorer
powerful_Zephyr5EF9
Explorer
Activity
‎Mar 06, 2025
10:17 PM
1 Upvote
@c.pfaffenbichler this is awesome i thought i would never do that thank you so much for this.
... View more
‎Mar 03, 2025
01:16 PM
1 Upvote
Hi everyone, i want to create photoshop script to set black point, white point, gray point on the curve from available color sample at specific position on image. set "black point" of curve from color sample at position x=1000, y=40 set "gray point" of curve from color sample at position x=1000, y=500 set "white point" of curve from color sample at position x=1000, y=960 i tried a program but it doesn't seem to work. my photoshop version is 25.12 please guide me, I appreciate your help. #target photoshop
function setCurvePoints() {
var doc = app.activeDocument;
// Get color sample values at specified positions
var blackPointSample = getColorSample(1000, 40);
var grayPointSample = getColorSample(1000, 500);
var whitePointSample = getColorSample(1000, 960);
// Create a new Curves adjustment layer
var idCurves = stringIDToTypeID("Curves");
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putClass(idCurves);
desc.putReference(charIDToTypeID("null"), ref);
executeAction(charIDToTypeID("Mk "), desc, DialogModes.NO);
var adjustmentLayer = doc.activeLayer;
// Set the black point
setCurvePoint(adjustmentLayer, blackPointSample, [0, 0]);
// Set the white point
setCurvePoint(adjustmentLayer, whitePointSample, [255, 255]);
// Set the gray point
setCurvePoint(adjustmentLayer, grayPointSample, [128, 128]);
alert("Curves adjustment points have been set.");
}
// Get color sample at specified position
function getColorSample(x, y) {
var samplePoint = [x, y];
var colorSampler = app.activeDocument.colorSamplers.add(samplePoint);
var colorSample = colorSampler.color.rgb;
colorSampler.remove();
return colorSample;
}
// Set a point on the Curves adjustment layer
function setCurvePoint(layer, colorSample, targetPoint) {
try {
var idCurves = stringIDToTypeID("curves");
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("AdjL"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
desc.putReference(charIDToTypeID("null"), ref);
var list = new ActionList();
var curvePoint = new ActionDescriptor();
curvePoint.putEnumerated(charIDToTypeID("Chnl"), charIDToTypeID("Chnl"), charIDToTypeID("RGB "));
curvePoint.putDouble(charIDToTypeID("Icnt"), targetPoint[0]);
curvePoint.putDouble(charIDToTypeID("Otpt"), targetPoint[1]);
list.putObject(idCurves, curvePoint);
desc.putList(charIDToTypeID("Adjs"), list);
executeAction(idCurves, desc, DialogModes.NO);
} catch (e) {
alert("Error setting curve point: " + e.message);
}
}
setCurvePoints();
... View more
‎Mar 02, 2025
02:44 PM
1 Upvote
it's work. thank you very much.
... View more
‎Mar 02, 2025
01:09 PM
Hi everyone, I want to do the following work by script but I don't know how to do it, I always do this: Step 1: go to Select Menu -> Color Range select: Skin Tones Fuzziness: 10 -> Click OK Step 2: Ctrl + J (make the selection range to a new layer). please guide me, I appreciate your help.
... View more
‎Feb 18, 2025
11:22 PM
1 Upvote
Thanks for your enthusiasm and friendliness, everything is fine.
... View more
‎Feb 18, 2025
09:27 PM
@Stephen Marsh thank you, it's works. but I forgot, there is one more step, this layer create a clipping mask with the layer below (Alt + Ctrl + G), please
... View more
‎Feb 18, 2025
05:10 PM
Hi everyone, I want to do the following work by script but I don't know how to do it, I usually use the key combination to create it: Step 1: create a visible layer (Ctrl + Alt + Shift + E) Step 2: Blur / AVG color that layer (Ctrl + Alt + F) Step 3: Invert it (Ctrl + I) please guide me, I appreciate your help.
... View more
‎Feb 18, 2025
04:57 PM
1 Upvote
@Stephen Marsh thank you very much, option 4 already work! luckily, i accidentally discovered that it is possible to tell photoshop to keep neutral points with the following command line: descriptor6.putBoolean(s2t("autoNeutrals"), true); it actually created neutral points:
... View more
‎Feb 18, 2025
08:24 AM
@Stephen Marsh luckily, i tried to create action for these options and when i looked at the details written there i was lucky to get 2 keywords. With option 2 "auto" for option 2 -> works With option 3 "autoBlackWhite" for option 3 -> works but when i tried to add checkbox "snap neutrals middtone" I combined keyword: "autoBlackWhitewithAutoNeuTrals" but it didn't work. With option 4: keyword "autoEnhanceBrightnessAndContrast" also didn't work Please help me fix the two keywords: autoBlackWhitewithAutoNeuTrals autoEnhanceBrightnessAndContrast
... View more
‎Feb 18, 2025
07:49 AM
hi @Stephen Marsh I have tried many keywords, ex: autoColor, autoColour, autoDarkLight, autoTone, autotone ... or with any keyword I can think of but it doesn't work. I also searched on forums and google but it doesn't seem to hit the mark. please guide me with the keywords in the algorithm section of Option2, Option3, Option4.
... View more
‎Feb 18, 2025
06:33 AM
hi everyone, I want to create an adjustment curve layer with "Find Dark & Light color" algorithm option by using script. The image is described as below. Please guide me the exact command. I appreciate your help
... View more
‎Feb 13, 2025
07:25 AM
it works. I can't thank you enough, I really appreciate your help.
... View more
‎Feb 13, 2025
12:41 AM
hi everyone, I want to create an adjustment curve layer with "Enhance Monochromatic Contrast" algorithm option by using script. The image is described as below. Please guide me the exact command. I appreciate your help
... View more
‎Feb 13, 2025
12:34 AM
1 Upvote
ok thank you.
... View more
‎Feb 13, 2025
12:09 AM
1 Upvote
@Stephen Marsh Thank you very much, it works fine. Can I ask you one more thing? I want to create an adjustment curve layer with the "Enhance Monochromatic Contrast " algorithm option. Please guide me the exact command.
... View more
‎Feb 12, 2025
11:13 PM
hi all, I want to create an exposure adjustment layer and then set the value using a script. I searched on google but no results. for example I want the script to create an exposure adjustment layer and set the following value: expousure = -0.17 gamma = 1.17 please guide me the exact command. I appreciate your help
... View more
‎Feb 11, 2025
09:47 PM
1 Upvote
thank you, it's work perfect.
... View more
‎Feb 11, 2025
09:01 PM
hi all, i want to create a hue/saturation adjustment layer. i tried the following commands but failed: app.activeDocument.artLayers.addAdjustment("Hue/Saturation"); app.activeDocument.layers.addAdjustment("Hue/Saturation"); please guide me the exact command.
... View more
‎Feb 10, 2025
04:12 PM
1 Upvote
thank you, it's works.
... View more
‎Feb 10, 2025
03:44 AM
i mean, i want to get the value of brightness. i tried getting the value this way but it didn't work var brightness desc1849.brightness; var brightness desc1849.Brgh; it returns undefined
... View more
‎Feb 07, 2025
09:56 AM
thank you, in the set_contrast function, how to get Brightness value?
... View more
‎Feb 07, 2025
07:55 AM
thank @Ghoul Fool At the moment, this code runs exactly as i want but unfortunately i dont know how to program in photoshop so this program is the result of patching together parts of code. i think it is not optimized. Goal: Apply auto brightness from "auto" Brightness/Contrast function in photoshop but keep only brightness value and remove contrast value. Step 1: Run the code to create "auto" brightness/contrast as default (not legacy). Step 2: Get brightness value and remove layer. Step 3: Create new Brightness/Contrast layer with brightness value obtained in step 2 and contrast value set to 0. Is there any way to set contrast value (set contrast = 0 or 1,2 ..) right after step 1? CODE: // STEP 1 - make Auto Brightness/contrast default // Apply auto brightness/contrast adjustment var autoDescriptor = new ActionDescriptor(); var reference = new ActionReference(); reference.putClass(stringIDToTypeID("adjustmentLayer")); autoDescriptor.putReference(stringIDToTypeID("null"), reference); var typeDescriptor = new ActionDescriptor(); var brightnessDescriptor = new ActionDescriptor(); brightnessDescriptor.putBoolean(stringIDToTypeID("auto"), true); brightnessDescriptor.putBoolean(stringIDToTypeID("useLegacy"), false); typeDescriptor.putObject(stringIDToTypeID("type"), stringIDToTypeID("brightnessEvent"), brightnessDescriptor); autoDescriptor.putObject(stringIDToTypeID("using"), stringIDToTypeID("adjustmentLayer"), typeDescriptor); var resultDesc = executeAction(stringIDToTypeID("make"), autoDescriptor, DialogModes.NO); /////////////////////////////////////////////////////////////////////////////////////////// // idle correction change so that photoshop removes the "auto" parameter from the adjustment object. var d = new ActionDescriptor(); var r = new ActionReference(); r.putEnumerated(stringIDToTypeID("adjustmentLayer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum")); d.putReference(stringIDToTypeID("null"), r); var data = new ActionDescriptor(); d.putObject(stringIDToTypeID("to"), stringIDToTypeID("brightnessEvent"), data); executeAction(stringIDToTypeID("set"), d, DialogModes.NO); /////////////////////////////////////////////////////////////////////////////////////////// var ref = new ActionReference(); ref.putEnumerated(charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt')); // reference is active layer var layerDesc = executeActionGet(ref); var layerID = layerDesc.getInteger(stringIDToTypeID('layerID')); // Use the function you found to get the brightness descriptor var brConDesc = get_contrast_desc(layerID); function get_contrast_desc(id) { try { var r = new ActionReference(); var d = new ActionDescriptor(); r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("json")); r.putEnumerated(stringIDToTypeID("document"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum")); d.putReference(stringIDToTypeID("null"), r); d.putInteger(stringIDToTypeID("layerID"), id); d.putBoolean(stringIDToTypeID("layerInfo"), true); d.putBoolean(stringIDToTypeID( "includeAncestors" ), false); eval("var json="+executeAction(stringIDToTypeID("get"), d, DialogModes.NO).getString(stringIDToTypeID("json"))); var d = new ActionDescriptor(); if (!json.layers) return d; if (json.layers.length != 1) return d; if (json.layers[0].id != id) return d; var adj = json.layers[0].adjustment; // alert("brightness="+adj.brightness); // shows undefined, even though the active layer is a Brightness/Contrast layer //alert("contrast="+adj.center); // shows undefined, even though the active layer is a Brightness/Contrast layer // STEP 2 - remove first Brightness layer var AutoBrightness1 = app.activeDocument.artLayers.getByName("Brightness/Contrast 1"); //AutoBrightness1.visible = false; AutoBrightness1.remove(); // STEP 3 - Add new brightness layer with Brightness value and without Contrast value. brightness_contrast(adj.brightness, 0, false); if (!adj) return d; if (adj.brightness != undefined) d.putInteger(stringIDToTypeID("brightness"), adj.brightness); if (adj.center != undefined) d.putInteger(stringIDToTypeID("center"), adj.center); if (adj.useLegacy != undefined) d.putBoolean(stringIDToTypeID("useLegacy"), adj.useLegacy); return d; } catch (e) { throw(e); } } // function brightnessAndContrast (brightness, contrast) // -------------------------------------------------------- function brightness_contrast(b, c, legacy) { if(legacy == undefined) legacy = false; // create new Brightness contrast adjustment layer // ======================================================= var idMk = charIDToTypeID( "Mk " ); var desc834 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); var ref206 = new ActionReference(); var idAdjL = charIDToTypeID( "AdjL" ); ref206.putClass( idAdjL ); desc834.putReference( idnull, ref206 ); var idUsng = charIDToTypeID( "Usng" ); var desc835 = new ActionDescriptor(); var idType = charIDToTypeID( "Type" ); var desc836 = new ActionDescriptor(); var iduseLegacy = stringIDToTypeID( "useLegacy" ); desc836.putBoolean( iduseLegacy, false ); var idBrgC = charIDToTypeID( "BrgC" ); desc835.putObject( idType, idBrgC, desc836 ); var idAdjL = charIDToTypeID( "AdjL" ); desc834.putObject( idUsng, idAdjL, desc835 ); executeAction( idMk, desc834, DialogModes.NO ); // ======================================================= var idsetd = charIDToTypeID( "setd" ); var desc826 = new ActionDescriptor(); var idnull = charIDToTypeID( "null" ); var ref201 = new ActionReference(); var idAdjL = charIDToTypeID( "AdjL" ); var idOrdn = charIDToTypeID( "Ordn" ); var idTrgt = charIDToTypeID( "Trgt" ); ref201.putEnumerated( idAdjL, idOrdn, idTrgt ); desc826.putReference( idnull, ref201 ); var idT = charIDToTypeID( "T " ); var desc827 = new ActionDescriptor(); var idBrgh = charIDToTypeID( "Brgh" ); desc827.putInteger( idBrgh, b ); //brightness var idCntr = charIDToTypeID( "Cntr" ); desc827.putInteger( idCntr, c ); //Contrast var iduseLegacy = stringIDToTypeID( "useLegacy" ); desc827.putBoolean( iduseLegacy, legacy ); var idBrgC = charIDToTypeID( "BrgC" ); desc826.putObject( idT, idBrgC, desc827 ); executeAction( idsetd, desc826, DialogModes.NO ); }
... View more
‎Feb 07, 2025
05:45 AM
Can I use a command to change the contrast value in the contrast value input field of the Brightness/Contrast control panel?
... View more
‎Feb 07, 2025
01:33 AM
no, I mean just change the value of contrast = 0, but keep the value of brightness the same.
... View more
‎Feb 06, 2025
07:30 PM
hi, i use the following code to create the brightness/contrast layer https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-automate-photoshop-s-quot-auto-quot-brightness-contrast-functionality-on-a-batch-of-images/m-p/13890434 Code: // Apply auto brightness/contrast adjustment var autoDescriptor = new ActionDescriptor(); var reference = new ActionReference(); reference.putClass(stringIDToTypeID("adjustmentLayer")); autoDescriptor.putReference(stringIDToTypeID("null"), reference); var typeDescriptor = new ActionDescriptor(); var brightnessDescriptor = new ActionDescriptor(); brightnessDescriptor.putBoolean(stringIDToTypeID("auto"), true); brightnessDescriptor.putBoolean(stringIDToTypeID("useLegacy"), false); typeDescriptor.putObject(stringIDToTypeID("type"), stringIDToTypeID("brightnessEvent"), brightnessDescriptor); autoDescriptor.putObject(stringIDToTypeID("using"), stringIDToTypeID("adjustmentLayer"), typeDescriptor); var resultDesc = executeAction(stringIDToTypeID("make"), autoDescriptor, DialogModes.NO); /////////////////////// but the contrast value often makes the image too contrasty, i want to set the contrast value = 0, please give me the command to do it.
... View more
‎Dec 29, 2024
06:10 AM
My needs were pretty simple, This program helped me turn off the layer that had less vibrant colors (which is a sign that less data was collected). So I kept the original program but I think you can definitely name the layer. So far it works pretty much like I wanted. For the action script I created two color samples from the source light and a midtone and overlaid them on two circles to select.
... View more
‎Dec 23, 2024
10:22 PM
1 Upvote
the program works very well, it will help me a lot. i really appreciate your help.
... View more
‎Dec 23, 2024
02:08 PM
My need is actually just to hide the layer with less colors (usually more color than 808080 gray) automatically. For example in the image above I need to hide circle B (closer to grey), in other cases it could be circle A if it is less colorful than B, closer to grey than B.
... View more
‎Dec 23, 2024
01:04 PM
I find the neutral gray point of an image using two methods: When the image is well exposed, neutral gray point A has more color and B has less color and is lighter. When the image is not well exposed, neutral gray point B has more color and A has less color and is lighter. Photos from birthday parties, graduations, or trips often contain many images with unstable exposure. so i have to click many times. I stacked them on top of each other and created an action in Photoshop to call the curve and used the auto click program to click exactly at the point where the two layers A,B overlap. But the new problem that arises is that when stacking, I even have to hide the mismatched layer manually. So I want to find a way to automatically hide the inappropriate layer (the layer with less color)
... View more
‎Dec 23, 2024
09:23 AM
I have two layers of color on top of each other, is there a way to calculate and hide the layer with less or lighter color? I would like to ask for a script to do that
... View more