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

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 , Windows

Views

1.2K

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

LEGEND , 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
...

Votes

Translate

Translate
Adobe
LEGEND ,
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.

Votes

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.

Votes

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

Copy link to clipboard

Copied

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 😉

Votes

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 16, 2022 May 16, 2022

Copy link to clipboard

Copied

Love this script Kukurykus! How would I modify it to sample from the right side of the image? Like 250, 250 pixels but from the top right side instead of top lef? 

Votes

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 ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

whtPnts(activeDocument.width - 250, 250)

Votes

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 Beginner ,
Nov 13, 2023 Nov 13, 2023

Copy link to clipboard

Copied

LATEST

Brilliant! Thank you. Have been searching for this for quite saome time.

Votes

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