Author Topic: Script for deflickering and ramping ACR (.xmp) settings in Bridge  (Read 219959 times)

limey

  • Member
  • ***
  • Posts: 134
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #175 on: February 22, 2014, 06:21:14 PM »
Based on this portion of one XMP file:

   crs:ProcessVersion="6.7"
   crs:Exposure2012="+8.65441"


Yes.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #176 on: February 22, 2014, 10:28:19 PM »
Wow that's a lot, the max is +/-5 so there is def. something wrong. Does the brightness appear to actually change after running the script? (8ev should be quite noticeable, in fact above 5 I think everything pretty much just turns white).

It would be most helpful if you could run that debug version and send me the output. Otherwise I'm just going to have to keep playing 20 questions with you like this.

finges

  • New to the forum
  • *
  • Posts: 8
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #177 on: February 28, 2014, 05:14:34 PM »
There's an "additive" mode so you can add to the existing value (useful for modifying the exposure value calculated by ML Post Deflicker, easier than the exif tool way, and you can make it ramp as well)
just saw this, especially the "additive" function is very good for postprocessing a night to day timelapse using ml post deflicker.
Thanks!

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #178 on: March 01, 2014, 01:33:01 PM »
Script still stops for me randomly.
XMP is being written correctly. It just stops in the middle of the process. If I press "cancel" after it hangs I get something like "resize undefined" if I remember correctly.

EDIT: It says "ReferenceError: resize is undefined"

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #179 on: March 01, 2014, 05:22:03 PM »
'resize' is a function of the preview image data object. This tells me that the preview data is probably for some reason not available. I've added a check to the debug version of the script. It should try to wait up to 30s for the preview to be 'ready'. If it's still not ready it should give you an error. Let me know if that helps.

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #180 on: March 01, 2014, 05:24:07 PM »
Great! Let me deflicker some other timelapse. Be back with the results.
Thank you!

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #181 on: March 01, 2014, 05:31:55 PM »
An error occurred while running a startup script named 'BridgeRampingScript'.  It may not be compatible with this version of Bridge; you can check for available updates by selecting the Updates command from the Help menu.  The script has been disabled, but can be re-enabled in the 'Startup Scripts' section of Preferences.

Error in /Users/itsskin/Library/Application Support/Adobe/Bridge CC/Startup Scripts/BridgeRampingScript.jsx
Line 736: int timeout = 30;//30 seconds
Illegal use of reserved word 'int'

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #182 on: March 01, 2014, 05:36:34 PM »
Haha, I've been writing too much C recently...

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #183 on: March 01, 2014, 05:39:16 PM »
try it now

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #184 on: March 01, 2014, 05:44:02 PM »
You are awesome :D Working now. int... var... who cares :D
Please give me some some time to run it with some test material.

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #185 on: March 02, 2014, 06:20:02 AM »
Ok, it did not hang this 2 times, but result is strange. Please have a look:
How keyframes looked


What script did:


Log:
https://dl.dropboxusercontent.com/u/17452116/Debug.zip

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #186 on: March 02, 2014, 04:36:44 PM »
Would you be so kind to explain how to choose percentile correctly. "Cross the sky"... What if it is day to night timelapse? How much to cross it?
Or may be just explain how it works, I still do not get it fully. Every single time it works ok, no matter if I select 0.7 0.8 or 0.9
Thx!

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #187 on: March 03, 2014, 12:09:00 AM »
Here's how the script works: first it computes the value of a given percentile of the image. So for example 0.5 would be the median, and would correspond to the value where half the pixels in the image have a brightness greater than that value and half have a brightness less than that value. For 0.7 that would mean the brightness at which 70% of the pixels are darker than that value and 30% are brighter than that value. Then it computes the same percentile of some target image. Then it applies a correction to the exposure to make the percentiles in each image match. So for example if we compute the median of some image to be 120 and the median of the target image to be 140, we would apply an exposure  compensation of +20 (converted to EVs of course), to try and get to that target value. The reason the script does multiple iterations is that ACR's curve is not linear and is not precisely known, so the EV is sort of 'best guess'. Then we see how well that guess came, say in our example our correction actually got us to 138. We would then apply just a little bit more to get to 140.

This method works b/c of the way brightness tends to be distributed in 'real' images. If you look at a probability distribution (a histogram of an image is simply a type of probability distribution), changing something like the stdev causes the average to change, while the median remains the same. We would say that the median (or a percentile, which is kind of like the same thing) is more 'statistically robust' than something like an average.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #188 on: March 03, 2014, 12:20:23 AM »
Ok, it did not hang this 2 times, but result is strange. Please have a look:
How keyframes looked
From the log it appears your keyframes were ignored. Not sure why this happened, I can't reproduce it. (If you're having trouble with the keyframes, you can always just do it section by section).

Looking at your keyframes I see a major problem though, the last keyframe (which is the only one that was used besides the first one) is massively underexposed. I think this is throwing everything off. The ACR exposure setting has a max of +/-5 and once you hit that it just goes to black, which is completely screwing the script's analysis. So you need to try and keep your exposure to within 5ev. If you ETTR you should pretty much stay within about 1 ev. If you're hitting the exposure limits when it gets fully dark, you may need to use a longer interval so you can use a longer exposure time (say up to about 30-45s, which is normally what I use).

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #189 on: March 03, 2014, 08:19:26 AM »
I ran the script again on the same sequence and it worked.
It was shot manually and I deliberately let last part become dark. Now I know it's not a good idea with the script :)

Thank you for describing percentile thing. It is that correct thinking, that it's better to deflicker sequence in parts, if one is bright and other is dark?
And what are the dots the preview shows?

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #190 on: March 03, 2014, 12:50:38 PM »
I ran the script again on the same sequence and it worked.
It was shot manually and I deliberately let last part become dark. Now I know it's not a good idea with the script :)
Yeah, it's better to always just expose properly and then just make it darker in post if you're going for something like a fade out.

It is that correct thinking, that it's better to deflicker sequence in parts, if one is bright and other is dark?
Yes (you may also need to adjust the analysis area or the percentile when the scene changes drastically like this).

And what are the dots the preview shows?
The dots are highlighting where that percentile actually is on the image. Basically, the pixels that have the same (or very close) to the value of the selected percentile are changed to red dots.

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #191 on: March 03, 2014, 09:04:51 PM »
So do we target highlights when selecting percentile?

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #192 on: March 04, 2014, 12:48:50 PM »
you want to target the area that gives the best representation of the overall luminance of the scene (which is usually the sky ;))

itsskin

  • Freshman
  • **
  • Posts: 67
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #193 on: March 04, 2014, 05:51:53 PM »
you want to target the area that gives the best representation of the overall luminance of the scene (which is usually the sky ;))
Makes sense. Thx again!

NickZee

  • New to the forum
  • *
  • Posts: 38
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #194 on: March 10, 2014, 04:45:30 AM »
Great Script!

Everything works like a charm.  Except one thing...

From the deflicker prompt when I click Preview.  I get the Bridge Script pop out window, but it is a blank white Source tab.  I can see the script on the right and in the drop down Bridge CS6 is selected as well as Main Engine. 

When I click the Play button, I get a secondary pop up that is titled,
 
"ExtendScript Toolkit 3.8"

Then, a big red X, and bold text. "Cannot execute script in target engine 'MainEngine'!"

The details are;

Cannot execute script in target engine 'MainEngine'!
(#1) ENGINE BUSY


If I exit the Bridge script window the Percentile Level goes from "---" to a specific number. 

If I hit Ok, the deflicker script works with out an issues.

So I'm just not seeing the Image preview, but everything else works great!

Any suggestions?

Thank you

Architectural Photography
NickZimmerman.com
5D MK3 & 600D | 24-70mm USMII L 2.8 | Nikon 14-24mm 2.8 | Nikon Nikkor 24mm 2.8 AIS & 50mm 1.4 AIS ** Windows 8.1 Pro | 32GB Ram | i7-4770 @ 3.4GHz

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #195 on: March 10, 2014, 12:00:31 PM »
The preview is supposed to open in whatever your default image viewer on your system is. On my computer (Mac) it pops open in the 'Preview' app. It sounds to me like it's trying to open in ExtendScript toolkit for whatever reason (which doesn't know how to deal with an image file). It was a lot easier to just call the image to be opened in an external program than to try and actually draw it in ScriptUI. Maybe your OS is trying to open the file in ExtendScript b/c it thinks it was 'created' by ExtendScript. I'm not really sure about how to fix it (other than bite the bullet and try to display the image within the ScriptUI), but if you can find the temp file location where the preview was being saved, you can open it manually with whatever image viewer.

PaulJBis

  • New to the forum
  • *
  • Posts: 46
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #196 on: March 10, 2014, 05:23:18 PM »
Hello:

I'm just trying our your script, and I found something that I don't know if it's a bug: if I select a range of RAW images and try to ramp the "temperature" setting... it ignores me. It doesn't change anything.

(Not that I care that much about ramping color temperature; I was just trying to find out what After Effects does when some images of a sequence have XMP files and others don't, and I needed to change something that was easy to see in the timeline).

Using Adobe CS6 on Windows 7, with Camera Raw 7.

PaulJBis

  • New to the forum
  • *
  • Posts: 46
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #197 on: March 10, 2014, 05:33:22 PM »
Great Script!

Everything works like a charm.  Except one thing...

From the deflicker prompt when I click Preview.  I get the Bridge Script pop out window, but it is a blank white Source tab.  I can see the script on the right and in the drop down Bridge CS6 is selected as well as Main Engine. 


Oh, the same thing happens to me too. I get the ExtendScript toolkit window; in the Javascript Console to the side, I get: "temp file path: C:\Users\Paulo\AppData\Local\Temp\PercentilePreview.jpg"... but the file in question is not there.

I'm on Adobe CS6 (using Bridge 64 bit), on Windows 7.

Since I do have some experience with coding, I'll do some research and see if I can debug this.

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #198 on: March 10, 2014, 05:41:05 PM »
I'm just trying our your script, and I found something that I don't know if it's a bug: if I select a range of RAW images and try to ramp the "temperature" setting... it ignores me. It doesn't change anything.

You probably don't have it set on 'Custom' white balance for some of your images. Select all the images, Open with ACR, and set the WB for all of them to custom (use 'Synchronize' button).

(If it's not on 'Custom' temperature gets ignored)

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Script for deflickering and ramping ACR (.xmp) settings in Bridge
« Reply #199 on: March 10, 2014, 05:43:48 PM »
Since I do have some experience with coding, I'll do some research and see if I can debug this.
Thanks, there's not much I can do, b/c I don't have Windows and it works fine on Mac.