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

Help With quickDevelopAdjustWhiteBalance

Participant ,
Sep 12, 2024 Sep 12, 2024

I am attempting to adjust the temperature and tint for a large number of images using photo:getDevelopSettings() but I am running into the bug mentioned here (and other places) where the temperature and tint = nil.

 

I'm not sure when this bug is going to be resolved so instead I am attempting to use quickDevelopAdjustWhiteBalance. However, I cannot figure out how to produce a consistent value from the amount setting in photo:quickDevelopAdjustWhiteBalance( settingName, amount )

 

For example, this photo:quickDevelopAdjustWhiteBalance( "Temperature", 1 ) produces various values depending on the current temperature value of the image.

At current temperature of 2000, it produces a result of +14

At current temperature of 3000, it produces a result of +17

At current temperature of 4000 it produces a result of +43

 

Could anyone help make sense of the calculation to produce a consistent value? For example, +100 every time.

TOPICS
SDK
513
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 ,
Sep 19, 2024 Sep 19, 2024

"I am running into the bug mentioned here (and other places) where the temperature and tint = nil."

 

That bug has been marked as fixed in LR 13, since no one has been able to reproduce it. Are you sure that you're accessing photo:getDevelopSettings ().Temperature and .Tint for raws only?  For non-raws, they will be nil (you need to access .IncrementalTemperature and .IncrementalTint).

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
Participant ,
Sep 20, 2024 Sep 20, 2024

Thanks for the response. Yes, this happens with only raw photos on version LrC 13 and above. To reproduce, I typically need to attempt to adjust quite a few photos (like 100 photos or so) but the bug is still there. To reproduce, I typically discard all standard previews, then set the white balance to as shot on the photos then do it.

 

Screenshot 2024-09-09 at 12.31.48 PM.png

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 ,
Sep 20, 2024 Sep 20, 2024

I poked around and, as you observe, the bug has reappeared since I last tested in LR 13.0.1. I updated the bug report with a modified recipe for reproducing it and asked Adobe to reopen the issue:

https://community.adobe.com/t5/lightroom-classic-bugs/p-sdk-photo-getdevelopsettings-sometimes-retur... 

 

The end of the post has a simple workaround that I've tested on 500 photos exhibiting the problem.  

 

I'm skeptical this will ever get fixed. The developer assigned to the bug last year clearly didn't understand the SDK API very well.

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 ,
Sep 20, 2024 Sep 20, 2024

And regarding your question about photo:quickDevelopAdjustWhiteBalance(), I did a little reverse engineering with Excel and came up with this approximation.

 

Given quickDevelopAdjustWhiteBalance ("Temperature", s), the new value of Temperature can be approximated with this formula:

 

(0.8785^s) * Temperature ^ (1.0164^s)

 

(at least for positive values of s -- I didn't investigate negative values).  

 

The approximation is accurate within a few percent when s <= 2 and Temperature <= 10000.  But the error increases to 10% or more for larger values.

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
Participant ,
Sep 20, 2024 Sep 20, 2024

Thanks, @johnrellis for doing this. If I am understanding your calculation correctly, I would still need the current value of Temperature (which is sometimes nil) if I wanted to use your calculation, correct?

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 ,
Sep 20, 2024 Sep 20, 2024
LATEST

"I would still need the current value of Temperature (which is sometimes nil) if I wanted to use your calculation, correct?"

 

That's right -- for a given value of "s" passed to quickDevelopAdjustWhiteBalance(), the absolute increment or decrement to Temperature depends on the current value of Temperature.

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
Participant ,
Sep 20, 2024 Sep 20, 2024

Thank you @johnrellis. Yes, based on your suggestion about building standard previews to resolve the issue, we've added this suggestion to our application. Much appreciated.

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