Set white point for multiple images

New Here ,
May 14, 2021 May 14, 2021

Copy link to clipboard

Copied

Hi.

 

I wan't to make a Photoshop action (or possibly a script) to set the white point on mulitple images. If I record an action with Curves or Levels, 'Sample in image to set white point', it will keep using the values of the first image, used to make the action. I want it to be as if I clicked the 'Set white point' in the same position on every image upon which the action is performed. Is this possible, and if so, how?

 

Thank you very much for your help. Best wishes, Mark.

 

For info... I'm creating a time lapse, using white background photos taken with a Raspberry pi camera, which has rather variable white balance results.

 

 

TOPICS
Actions and scripting, How to, Windows

Views

832

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

Adobe Community Professional , May 14, 2021 May 14, 2021
function whtPnts() { sTT = stringIDToTypeID, arr = ['horizontal', 'vertical']; (ref = new ActionReference()).putClass(sTT('colorSampler')); (dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref) dsc2 = new ActionDescriptor(); while(arr.length) dsc2.putUnitDouble (sTT(arr.shift()), sTT('pixelsUnit'), arguments[+!arr.length]) dsc1.putObject(sTT('position'), sTT('point'), dsc2) executeAction(sTT('make'), dsc1) rgb = activeDocument.colorSamplers[0].color.rgb c = sTT('channel'), p...

Likes

Translate

Translate
Adobe Community Professional ,
May 14, 2021 May 14, 2021

Copy link to clipboard

Copied

 

function whtPnts() {
	sTT = stringIDToTypeID, arr = ['horizontal', 'vertical'];
	(ref = new ActionReference()).putClass(sTT('colorSampler'));
	(dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref)
	dsc2 = new ActionDescriptor(); while(arr.length) dsc2.putUnitDouble
	(sTT(arr.shift()), sTT('pixelsUnit'), arguments[+!arr.length])
	dsc1.putObject(sTT('position'), sTT('point'), dsc2)
	executeAction(sTT('make'), dsc1)

	rgb = activeDocument.colorSamplers[0].color.rgb
	c = sTT('channel'), prprts = rgb.reflect.properties
	dsc1 = new ActionDescriptor(), lst1 = new ActionList(); for(i = 0; i < 3; i++) {
		(ref = new ActionReference()).putEnumerated(c, c, sTT(nme = prprts[i].name));
		(dsc2 = new ActionDescriptor()).putReference(c, ref); (lst2 = new ActionList())
		.putInteger(0), lst2.putInteger(rgb[nme]), dsc2.putList(sTT('input'), lst2)
		lst1.putObject(sTT('levelsAdjustment'), dsc2)
	}

	dsc1.putList(sTT('adjustment'), lst1)
	executeAction(sTT('levels'), dsc1)
}

whtPnts(250, 500)

 

Save above code to WhitePoints.jsx in Presets / Scripts of your Photoshop folder, then (re)launch Ps.

Create Action and Insert Menu Item to it from (File / Scripts) named WhitePoints.

Then use File / Automate / Batch to play your action on another files.

Ps. 250 & 500 is examplary pixels position for Color Sampler tool.

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 ,
May 14, 2021 May 14, 2021

Copy link to clipboard

Copied

Hi Kukurykus,
It worked! That's absolutely brilliant. Thank you so much.

Did you write it yourself, especially for my problem? Or is it something that's generally available? I was beginging to think I'd have to write a stand alone c++ program to do it.

What is the language of the that script? Is there a resourse from which I can learn it?

Thanks again for your help.

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
Adobe Community Professional ,
May 14, 2021 May 14, 2021

Copy link to clipboard

Copied

LATEST

Yes, especially for your problem, wrote in Extendscript: ADOBE PHOTOSHOP SCRIPTING

That is language made from old implementation of Javascript. Mark my answer as correct 😉

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