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

SDK or API to run Lightroom Classic's Tone Control > Auto and White Balance > Auto

New Here ,
Jul 18, 2025 Jul 18, 2025

Does Adobe Lightroom have an SDK or a set of APIs that will let me do something like this:

// fetch a photo image file from local hard drive or network
Image img_original = Image.FromFile("C:\Event123\original\DSC_1337.jpg");

// Use Lightroom's ToneControl.Auto on the ORIGINAL image to create a NEW image
Image img_new = LightroomUtilities.ToneControl.Auto(img_original);

// take that NEW image and perform Lightroom's WhiteBalance.Auto on it
img_new = LightroomUtilities.WhiteBalance.Auto(img_new);

// save the NEW image to a local folder
img_new.Save("C:\Event123\corrected\DSC_1337.jpg");

 I've researched Lightroom's APIs and Firefly APIs several times for the past several months.  And I do not thing this is possible.

 

Here's the context...

 

I photograph events where I may shoot 1000s (or tens of 1000s) of photos.  Then after the event, I load the photos into Lightroom and run Tone Control > Auto on all of them.  And often White Balance > Auto as well.  I usually do this in batches of about 1000 to 2000 images at a time.

 

defaultbxp8y49jqiek_1-1752867741528.png

 

What I'd like to do is have Lightroom do these tasks for me automatically during the event while I am shooting.

 

I'm a software developer, so I already have my own software to move image files from the camera to a computer, from drive to drive, up to the web, etc.  I don't need Lightroom to do any of these things for me.

 

All I need is to tell Lightroom...

  1.  To fetch an image at a local path and file name that I tell it (not an image that's in the cloud).
  2.  To perform Tone Control > Auto on that image.
  3.  To perform White Balance > Auto on that image.
  4.  To export that image to another local path and file name that I tell it.

 

Then when I'm ready, my code needs to tell Lightroom to do the same thing for my next image.

 

What I'm really looking for is an SDK or a set of local API endpoints (not in the cloud) so that I can access Lightroom features without having to open up Lightroom.

 

Is what I'm asking for possible?

  • Some kind of SDK or API set that accesses Lightroom's Tone Control > Auto and White Balance > Auto features.
  • Does its work on the local machine.  Does NOT require the full resolution image (or any image) to be pushed up to the cloud.
  • Does not require a user to interact with the Lightroom UI at all.  It's okay to have Lightroom open, if necessary.

 

Thanks!

TOPICS
SDK , Windows
414
Translate
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 , Jul 18, 2025 Jul 18, 2025

Lightroom Classic has an SDK with an extensive API that lets you control most aspects of the catalog and photo processing. You can download the SDK, including both an API reference and an introductory Lightroom Classic SDK Programmers Guide, from here:

https://developer.adobe.com/console/67648/servicesandapis

 

I can't give you a direct link to the SDK because that web site is horribly designed and confusing.

 

Beware there's a pretty steep learning curve to do more than write a trivial script, espec

...
Translate
LEGEND ,
Jul 18, 2025 Jul 18, 2025

Lightroom Classic has an SDK with an extensive API that lets you control most aspects of the catalog and photo processing. You can download the SDK, including both an API reference and an introductory Lightroom Classic SDK Programmers Guide, from here:

https://developer.adobe.com/console/67648/servicesandapis

 

I can't give you a direct link to the SDK because that web site is horribly designed and confusing.

 

Beware there's a pretty steep learning curve to do more than write a trivial script, especially if you don't know the Lua programming language, a very minimal but powerful language in which most of the LR app is written. I highly recommend investing a couple hours reading a Lua tutorial.

 

Debugging LR plugins with print statements is a huge waste of time.  Invest in learning the Zerobrane IDE or my Debugging Toolkit for Lightroom Plugins.  The toolkit is not as powerful as the IDE but is better integrated with Lightroom's task architecture.

 

If you try to just dive in and hack without learning Lua or getting a debugger, you'll regret it.

 

* *  *

Some hints about where to start:

 

To set White Balance to Auto, you can do:

photo:applyDevelopSettings {WhiteBalance = "Auto"}

 

But you can't do that for Auto Settings. The only way for a plugin to set Auto Settings is by applying a preset with photo:applyDevelopPreset(). So you might define a preset that sets both Auto Settings and White Balance and have the plugin apply that preset.

 

 

 

Translate
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 ,
Jul 18, 2025 Jul 18, 2025

Thank you, @johnrellis.  I'll check out the Zerobrane IDE and your Debugging Toolkit.  As well as the SDK link you posted.

 

And help me make sure that I understand you correctly.  When you say "But you can't do that for Auto Settings," are you saying that it's not possible to perform the Tone Control > Auto feature using the SDK (per my screen snip in the OP)?

 

That's my main purpose for wanting to access LR features via SDK.  I want LR to auto-adust the exposure, contast, highlights, shadows, whites, blacks, vibrance and saturation for each individual image.  On the fly.  The composition, colors, lighting, etc can vary from image to image.  So a single preset would not work.

 

Or perhaps is there a way to do an auto-set for each of those individual properties?  auto-exposure, auto-contast, auto-highlights, etc.

 

Thanks!

 

Translate
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 ,
Jul 18, 2025 Jul 18, 2025

A plugin can't use photo:applyDevelopSettings() to set Auto Settings. But it can apply a preset that sets Auto Settings and White Balance using photo:applyDevelopPreset().

Translate
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 ,
Jul 18, 2025 Jul 18, 2025

Thanks so much, @johnrellis.  I'm sure what you're saying will become obvious to me after I've dug into it for a while.

Translate
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
Advocate ,
Jul 19, 2025 Jul 19, 2025

@RD Hi 

It is possible to run Auto Tone via SDK but only in Develop using 

LrDevelopController.setAutoTone()


If you are looking for a way to do Auto Tone automatically in Library then is better to apply a preset as @johnrellis said.

.

Translate
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 ,
Jul 19, 2025 Jul 19, 2025

Thanks for that info, @C.Cella!

 

I gather that when you and @johnrellis mention the notions of "in Library" and "in Develop" that you are refering to what we see here in the LR UI.  Correct?

 

In Library ...

RDHi_0-1752960508010.png

In Develop ...

RDHi_1-1752960628430.png

 

If so, that begins to make sense.

 

I'm still thinking very simplisticly, like the way I wrote my pseudo-code in my OP.  As I get into the SDK and the docs, I'll post my progress and solution here.

 

My 3rd grade brain tells me that the first thing I need to figure out how to do is to tell the LR SDK which image file on my hard drive that I want to work with.  Then do the setAutoTone() and a SaveImage() method of some kind.

LrDevelopController.GetImage("C:\Event123\original\DSC_1337.jpg");
LrDevelopController.setAutoTone();
LrDevelopController.SaveImage("C:\Event123\corrected\DSC_1337.jpg");

 

Thanks again.  I feel like you're pointing me in the right direction.

Translate
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 ,
Jul 19, 2025 Jul 19, 2025

Figure out what you want to do manually, using LR's terminology and concepts: import one or more photos to the LR catalog, apply a preset to those photos, then export them in the desired format. Then look at the APIs corresponding to that terminology.

Translate
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 ,
Jul 21, 2025 Jul 21, 2025

Very helpful.  Thank you, @johnrellis.

Translate
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
Enthusiast ,
Jul 19, 2025 Jul 19, 2025

@RD Hi wrote

 

"I'd like to do is have Lightroom do these tasks for me automatically during the event while I am shooting ...

 

... I'm a software developer, so I already have my own software to move image files from the camera to a computer, from drive to drive, up to the web, etc.  I don't need Lightroom to do any of these things for me.

 

All I need is to tell Lightroom...

  1.  To fetch an image at a local path and file name that I tell it (not an image that's in the cloud).
  2.  To perform Tone Control > Auto on that image.
  3.  To perform White Balance > Auto on that image.
  4.  To export that image to another local path and file name that I tell it."

 

I don't understand this workflow, but I can tell you that the SDK will do very little to help you.

 

In order for LrC to do anything to an image, it must be Imported into a catalog first.

 

You say "I already have my own software to move image files from the camera to a computer". Is this while you are shooting the event? If so, how is the camera connected to the computer? Is it tethered?

 

LrC's Tethered Capture allows you to apply a Develop Preset on capture; it is easy to create a Develop Preset to apply Auto Settings and Auto WB.

 

If you can't use Tethered Capture or don't want to, then LrC can be configured to Auto Import from a 'Watched Folder'; the same applies as in the Tethered Capture, a Preset can be applied on Auto Import.

 

Trying to do what you want with the SDK is not easy, but it is possible. I question why would you bother when LrC is already capable of doing it for you.

 

I also ask why do you need Step 4 while shooting at an event?

 

Translate
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 ,
Jul 21, 2025 Jul 21, 2025

Thank you @drtonyb for your thoughts and feedback.  You're essentially asking the most important question of all.  Which is "What are you actually trying to accomplish?  What's the overall business problem you're trying to solve?"

 

However, I need the scope of this conversation to be confined to how to access LrC's Tone Control > Auto and White Balance > Auto features on an image programatically, automatically, locally and outside of the LrC UI.

 

Like I mentioned in my OP, I've already built all the processes in my workflow.  From the camera, to the backend, to a retail frontend.  These processes have been in place for years.  They are modular, fast, robust, don't spend time rendering to a screen, and run completely unattended by a human.

 

Plus, I already have a process in place that does exactly what I'm exploring with LrC.  I'm merely exploring an alternative.  And I like what I see from those 2 Adobe LrC features.

 

And you may be correct, that the LrC SDK won't do what I'm asking.  I mentioned that possibility in my OP.  But I'll find out for sure and post my results here.

 

Thanks!

Translate
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
Enthusiast ,
Jul 21, 2025 Jul 21, 2025
LATEST

@RD Hi 

It seems that you want to use the LrC SDK outside of LrC. Not possible.

 

For your information, here is a script that prompts for image files, imports them and then applies an existing Develop Preset named "Auto Preset" which is saved in the group named "Auto".

 

local LrApplication = import 'LrApplication'
local LrDialogs = import 'LrDialogs'
local LrTasks = import 'LrTasks'


local function getDevelopPreset( presetName, folderName )
	local group
	local developPreset

	for _, folder in ipairs( LrApplication.developPresetFolders() ) do
		if folder:getName() == folderName then
			group = folder
			break
		end
	end

	if nil ~= group then
		for _, preset in ipairs( group:getDevelopPresets() ) do
			if preset:getName() == presetName then
				developPreset = preset
				break
			end
		end
	end

	return developPreset
end


LrTasks.startAsyncTask( function()
	local presetGroup = 'Auto'
	local presetName = 'Auto Preset'

	local catalog = LrApplication.activeCatalog()

	local preset = getDevelopPreset( presetName, presetGroup )

	if nil == preset then
		LrDialogs.message( string.format( 'Failed to find the %s', presetName ) )
	else
		local sources = catalog:getActiveSources()

		local folderPath = nil ~= sources[1] and 'LrFolder' == sources[1]:type() and sources[1]:getPath()

		local images = LrDialogs.runOpenPanel( {
			title = 'Import Photo',
			canChooseFiles = true,
			canChooseDirectories = false,
			canCreateDirectories = false,
			allowsMultipleSelection = true,
			initialDirectory = folderPath,
		} )

		if nil ~= images then
			local photo

			for _, imagePath in ipairs( images ) do

				catalog:withWriteAccessDo( string.format( 'Import Photo with %s', presetName ), function( context )
					photo = catalog:addPhoto( imagePath, nil, nil, nil, preset:getUuid() )

					if nil ~= photo then
						photo:applyDevelopPreset( preset )
					end
				end )
			end

			-- select the last imported photo
			catalog:setSelectedPhotos( photo, {} )
		end
	end
end )

 

Place the script with a .lua extension in a folder called Scripts under "%appdata%\Adobe\Lightroom", then start LrC. Scripts can be launched from the Scripts menu in LrC.

 

Translate
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