Script for deflickering and ramping ACR (.xmp) settings in Bridge

Started by dmilligan, October 17, 2013, 12:32:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Danne

Hi! Tried it on my mac on adobe cs6 but no success :(. Is there anything I,m missing here? It looks like this.

RenatoPhoto

I tested the new script and gave me the two options.  I tried first to ramp the exposure but this did not work.  It did not process any images.
The deflicker option worked on the files but the deflicker did seem proper.  i will test again..
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

dmilligan

oops, broke the ramping accidentally, try it now.

You need to make sure you pick an appropriate percentile, according to a1ex pick a percentile that 'crosses the sky'.

Also you might have to do several passes. Make sure the Bridge previews get regenerated between iterations (right click and go to "Purge Cache for Selection").

Here's an example of the preview (0.7 percentile highlighted):

Danne

Hi again. Got it to work. Wasn,t aware I had to copy paste the coding from the link to get it to work. First I simply downloaded the jsx file from the first post which obviously didn,t work. Thanks again Dmilligan.
//D

Joachim Buambeki

Just discovered this. Great work (again) David.

A few questions:

- Can you ramp values based on keyframes (frames that are marked with 1 star)? For a sunset one would pick 6 frames for example, adjust WB, exposure, shadows, highlights, colours, etc. and let your script ramp ALL sliders you can access within ACR including the curves? That would be MUCH easier than the current dialogue because you could use ACR dialog itself and see what you are actually doing.

- If that is possible, could you also animate/ramp the graduated and radial filter? They are useful for sunsets and/or when you have a dolly shot or want to track a subject like the milky way.

- Could you add a small dialogue to create those keyframes where you enter how many of them you want and they are evenly distributed evenly over the sequence then?

- Can you detect sudden changes in shutter speed with the script? Since you can't bulb ramp with Nikon cameras you have to adjust the shutter speed in steps of x EV (depending on how fine you want the steps to be) from day to night and then smooth those transitions, could you automate that? Those frames could be marked with 2 stars for the first and 3 stars the second of each pair.

- If the keyframing is possible, can you take care that those keyframes aren't changed by the deflickering algorithm? Meaning the exposure of those stays untouched and the surrounding frames are adjusted accordingly.

- If the keyframing is possible, what happens if I change the keyframes after the deflickering? Do I have to run those multiple passes again or could the offset for each frame be stored and be adjusted to those .xmp values of the keyframes?

- How robust is the deflickering? What if there are headlights from a car in a single frame, will the exposure of this frame be lowered because of its higher overall brightness? If it works that way and since you can access the small bridge preview image, could you add threshold that discards sudden local changes in brightness as flickering? Black birds in the sky or a fly one the lens would be another example where the deflickering algorithm might be thrown off.

- Could you implement a dialogue to raise/lower exposure of the sequence of after it has been colour corrected and deflickered? I often find the overall sequence a tad to dark/bright after reviewing the whole sequence and want to raise/lower the overal exposure.


Keep up the good work, it is really appreciated. :-)

dmilligan

It seems that some folks downloaded the link I posted in the OP, which is actually an html page for the script, not the script itself, which is why you had trouble running it. I have updated the OP with the link to the actual raw file, so you can just right click and download, sorry for the confusion. (If you saw a bunch of html tags in an error message, this is probably what happened)

Joachim Buambeki

Quote from: dmilligan on October 20, 2013, 09:50:06 PM
It seems that some folks downloaded the link I posted in the OP, which is actually an html page for the script, not the script itself, which is why you had trouble running it. I have updated the OP with the link to the actual raw file, so you can just right click and download, sorry for the confusion. (If you saw a bunch of html tags in an error message, this is probably what happened)

Sorry for asking, but where am I supposed to put the scripton my Win8 CC version? I don't have the folder you're describing in your opening post. As of now I am opening the script by opening it in Bridge each time I start it.

dmilligan

Quote from: Joachim Buambeki on October 20, 2013, 12:57:22 PM
- Can you ramp values based on keyframes (frames that are marked with 1 star)? For a sunset one would pick 6 frames for example, adjust WB, exposure, shadows, highlights, colours, etc. and let your script ramp ALL sliders you can access within ACR including the curves? That would be MUCH easier than the current dialogue because you could use ACR dialog itself and see what you are actually doing.
I like your idea about using the the existing ACR settings to do the ramp, I can have the dialog pull the values of the selected setting from the first and last selected photos as the default for the text boxes. And then also have some kind of "ramp all" option.

I don't really think keyframes are necessary, just select the photos in groups and do one ramp at a time. I don't think that's any more difficult than defining keyframes, and makes things much less complicated for the script (and me).

Quote from: Joachim Buambeki on October 20, 2013, 12:57:22 PM
- If that is possible, could you also animate/ramp the graduated and radial filter? They are useful for sunsets and/or when you have a dolly shot or want to track a subject like the milky way.
Is stuff like this really necessary to do with ACR? Why not do stuff like that in AE? You should be able to achieve exactly the same results.

Quote from: Joachim Buambeki on October 20, 2013, 12:57:22 PM
- Could you implement a dialogue to raise/lower exposure of the sequence of after it has been colour corrected and deflickered? I often find the overall sequence a tad to dark/bright after reviewing the whole sequence and want to raise/lower the overal exposure.
This is already possible, just use the "additive" mode.

Quote from: Joachim Buambeki on October 20, 2013, 12:57:22 PM
- Can you detect sudden changes in shutter speed with the script? Since you can't bulb ramp with Nikon cameras you have to adjust the shutter speed in steps of x EV (depending on how fine you want the steps to be) from day to night and then smooth those transitions, could you automate that? Those frames could be marked with 2 stars for the first and 3 stars the second of the pair.
Just use the deflicker.

Quote from: Joachim Buambeki on October 20, 2013, 12:57:22 PM
- How robust is the deflickering? What if there are headlights from a car in a single frame, will the exposure of this frame be lowered because of its higher overall brightness? If it works that way and since you can access the small bridge preview image, could you add threshold that discards sudden local changes in brightness as flickering? Black birds in the sky or a fly one the lens would be another example where the deflickering algorithm might be thrown off.
I think it should be pretty robust. It's based on the histogram, so transients should be okay as long as they have a relatively small impact on the overall histogram distribution. A1ex could answer questions about the theory behind this, better than I can.


dmilligan

Quote from: Joachim Buambeki on October 20, 2013, 11:07:05 PM
...Win8...

Sorry, I feel your pain. I have no idea, if Microsoft decided to move that stuff around, there's no telling. Honestly, a child could come up with a better directory structure than Windows has. It's seriously embarrassing for MS, but I think MS should be embarrassed by Windows in general. I have no idea why people use that crap. (or why they PAY for it when linux is FREE!).

Maybe try doing a search for "Bridge CC", though I've heard Win8's search is pretty much totally useless, would end up searching the internet, even if you are just looking for a local file.

Joachim Buambeki

Quote from: dmilligan on October 20, 2013, 11:40:00 PMI have no idea why people use that crap. (or why they PAY for it when linux is FREE!).
The day you or anyone else hacks together a patch for Adobe programms to use the MacOS (=Unix) version on Linux I am done with Windows - I'll give you my word on that...

Quote from: dmilligan on October 20, 2013, 11:40:00 PMMaybe try doing a search for "Bridge CC", though I've heard Win8's search is pretty much totally useless, would end up searching the internet, even if you are just looking for a local file.
Thanks, I'll do some searching on the interwebz, I wasn't able to find the folder with the search in the explorer - not that this ever was of any use since I am with Win95...


RenatoPhoto

Quote from: Joachim Buambeki on October 20, 2013, 11:07:05 PM
Sorry for asking, but where am I supposed to put the scripton my Win8 CC version? I don't have the folder you're describing in your opening post. As of now I am opening the script by opening it in Bridge each time I start it.
Probably something like this: C:\Users\RE\AppData\Roaming\Adobe\Bridge CS6\Startup Scripts

Or search in C:\Users for "scripts"
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Joachim Buambeki

Quote from: dmilligan on October 20, 2013, 11:31:33 PMI like your idea about using the the existing ACR settings to do the ramp, I can have the dialog pull the values of the selected setting from the first and last selected photos as the default for the text boxes. And then also have some kind of "ramp all" option.
I don't really think keyframes are necessary, just select the photos in groups and do one ramp at a time. I don't think that's any more difficult than defining keyframes, and makes things much less complicated for the script (and me).
I am just talking from a user POV, so I don't know how much work the coding is and I am grateful for the work you put in, but IMO keyframes are crucial for an easy workflow. For me ramping those sets is pretty annoying when having 10+ keyframes, especially since I tend to re-edit my keyframes alot during editing.
If keyframing would be implemented like layed out in my previous post (or in a similar manner) this could become a serious alternative for commercial software (which uses the star rating in the manner I proposed), the deflickering could even be able to surpass it in quality because it works directly with the output of ACR's render engine.

Quote from: dmilligan on October 20, 2013, 11:31:33 PMIs stuff like this really necessary to do with ACR? Why not do stuff like that in AE? You should be able to achieve exactly the same results.
I am no experienced colorist, but changing white balance (hint: gamma correction), contrast and other things localy on an already highly graded image with a bad ratio of noise vs. signal (like a noisy milky way shot) is pretty hard to do for me within After Effects. If you would attempt to try/do it you would defeat the whole purpose of the scripting which is getting highest quality output from a RAW file IMHO. In that case you would be better off to output a flat interpretation of the actual RAW file and do ALL (=global and local) adjustments in AE or a designated colour grading suite like Speedgrade or Resolve.
By the way, all those features are implented in commercial software, some of them based on requests made by users.

Quote from: dmilligan on October 20, 2013, 11:31:33 PMJust use the deflicker.
I would have to run deflickering then within every set of keyframes to keep them at the brightness I want them to be, right? This is again a case where the proposed keyframing integration would be handy for a much smoother workflow.

Quote from: dmilligan on October 20, 2013, 11:31:33 PMThis is already possible, just use the "additive" mode.
Maybe you could create a small wiki like with your HDR script to clarify things?

Quote from: dmilligan on October 20, 2013, 11:31:33 PMJust use the deflicker.
So, the deflickering would have to be processed again in sets of neighboring keyframes? If yes, my plea would be the same as in the first paragraph of this posting.

Quote from: dmilligan on October 20, 2013, 11:31:33 PMI think it should be pretty robust. It's based on the histogram, so transients should be okay as long as they have a relatively small impact on the overall histogram distribution. A1ex could answer questions about the theory behind this, better than I can.
Ok, I'll try if I can break it with one of my sequences with such frames.
By the way: Is deflickering supposed to be that slow? With high precision, it takes half an hour on my 4GHz quadcore (though only one core seems to be used).

PPS: Did you see my reply to this thread? Just in case you missed it.

Joachim Buambeki

Quote from: RenatoPhoto on October 21, 2013, 12:05:10 AM
Probably something like this: C:\Users\RE\AppData\Roaming\Adobe\Bridge CS6\Startup Scripts

Or search in C:\Users for "scripts"
I figured it out, I had to create folder myself within the Bridge directory and put the script in there. Maybe this should be added to the initial post?

dmilligan

Quote from: Joachim Buambeki on October 21, 2013, 01:26:10 AM
By the way: Is deflickering supposed to be that slow? With high precision, it takes half an hour on my 4GHz quadcore (though only one core seems to be used).

Yeah, that's the major drawback, doing image processing in scripting language is not exactly efficient. 99% of that time is spent simply generating the histogram. Something that should take a fraction of a millisecond takes 1-2 seconds in javascript. Nothing I can really do about it except write this in native code, which would kind of defeat the purpose, which is that it's extremely easy and simple and only requires Bridge to run. Alex is working on something that will be native and not require Bridge, so why duplicate the effort there.

You can play with the skip lines parameter and see how large you can make it before the histogram becomes inaccurate (basically it's skipping over pixels when calculating the histogram to improve speed, at some point you start drifting away statistically from the true histogram). It should be okay to at least skip 3 like I have as the default, there's more error in the ev calculation than in the histogram calculation at that point. If you have a lot of clear sky in the image (a smooth gradient) you should be able to get away with skipping 5 or 6 I should think.

If I could figure out a way for Br to give me a histogram it would be much much faster, but I haven't found anything. Taking the time to open in photoshop and getting a histogram from there would be slower I think than just computing in javascript.

If you would like to write a C++ plugin to Br for calculating the histogram I would gladly incorporate it into the script.

Joachim Buambeki

Quote from: dmilligan on October 21, 2013, 03:21:17 AMIf you would like to write a C++ plugin to Br for calculating the histogram I would gladly incorporate it into the script.
Unfortunatelly I have zero programming knowledge. A while ago I stumbled over this but never got it to work because it is written for CS5 and doesn't work with later versions. I am not sure if it is of any use or your script is already doing something similar to get the histogram.

dmilligan

@Joachim
So I think I finally understood what you meant by the keyframe thing with the star rating (I was thinking you wanted me to come up with some kind of dialog/UI for creating keyframes, the rating thing is not to hard at all) and I have implemented it for the deflicker and a new "Ramp All ACR Settings" menu. Good idea, thanks.


Mark the frames that you don't want to be touched (used as keyframes) with 1 star. First and last selected frames are assumed to be keyframes even if not marked. Deflicker will run the histogram matching on a ramped EV target from one keyframe to the next. "Ramp All ACR Settings" works basically the same way, except just blindly ramping all settings from one keyframe to the next.

Danne

Finally got some time to play around with your script. I must say this is brilliant stuff. The ramping method using "ramp all ACR settings is perfect". I just tried starring 6 in and out points and by simply editing first and last of each starred pic it performed the ramping flawlessly exactly like I wanted. Gonna explore some more on occasion. Meanwhile. Biggest thanks!
//D

Danne

Hi! Anybody maybe someone could shed some light.
When using "ramp all ACR settings" it all works accordingly. When selecting "ramp ACR setting" it doesn,t respond. Also when applying deflicker I can,t see any changes whatever percentile I try? I only tried selecting around 10 pictures for tryout
My setup is this.

1 - Import dual iso files with applied xmp sidecarfiles which I apply to the metadata inside the cr2 files through lightroom.
2 - Importing the cr2 files to bridge and all my metadata changes follows nicely.
3 - trying to apply the script. Only get the "ramp all ACR settings" to work



*somehow my deflickering started to work with the new script? I don,t know why really? Gonna investigate further.
Deflicker now seems to work but not the exposure ramping with "the ramp ACR settings" in the new script. In the older one it works

agour

Just been trying out the deflicker, but can't seem to get it to work.

It runs through and processes the files, however bridge doesn't 'find' them in the normal way (where it shows a little icon on the top right of thumbnail preview). I opened a few images and they DID however have adjustments applied... Weird.

I left the deflicker at default settings and ran it through. It didn't work at all, so I'm not sure what's going on. Has anyone else experienced this issue before?


HOWEVER, that 'ramp all ACR settings' is GENIUS. It's so easy to use, it's going to help me out a lot! Another question, will it affect the exposure adjustments, or just ramp the other settings?

Danne

Quote from: agour on October 24, 2013, 04:39:10 PM
HOWEVER, that 'ramp all ACR settings' is GENIUS. It's so easy to use, it's going to help me out a lot! Another question, will it affect the exposure adjustments, or just ramp the other settings?

It affects all settings, exposure included. Would be swift to be able to unselect parameters but that,s when I tried the other setting, which I couldn,t get to work :). It is still crazy good being able to ramp several points...

Danne

Actually, I tried an older script which doesn,t contain the "ramp all ACR settings" and this one works with deflicker and so on. Maybe something wrong with the latest script?
Did two "passes" with deflickering and it worked very good!

*somehow my deflickering started to work with the new script? I don,t know why really? Gonna investigate further.
Deflicker now seems to work but not the exposure ramping with "the ramp ACR settings" in the new script. In the older one it works

dmilligan

Quote from: agour on October 24, 2013, 04:39:10 PM
I left the deflicker at default settings and ran it through. It didn't work at all, so I'm not sure what's going on. Has anyone else experienced this issue before?

I'm not sure what you mean by "didn't work at all". Did it do anything (did you see the progress window?) or did it just not deflicker correctly - it applied exposure corrections but they were wrong? Did your images already have xmp sidecars? If so, when you did the deflicker were they modified? If not already created, were they created? Can you post the image that's generated when you click the 'Preview' button in the deflicker dialog.

Danne

For myself it,s now only the "ramp ACR setting" that doesn,t apply changes. Really nice script I must say anyway

dmilligan

Updates:
Fixed 'Ramp ACR Setting...' and renamed to just 'Ramp...'
Renamed 'Ramp All ACR Settings" to 'Ramp Multiple...' and added option to select which things to ramp (like the ACR dialog when you select 'Synchronize...').
Added some error handling so hopefully it will be easier to diagnose errors you guys come across.

Joachim Buambeki

Quote from: dmilligan on October 22, 2013, 11:41:55 PM...(I was thinking you wanted me to come up with some kind of dialog/UI for creating keyframes, the rating thing is not to hard at all) and I have implemented it for the deflicker and a new "Ramp All ACR Settings" menu.
Actually that was part of my earlier post. It would be nice to have dialoge that asks you how many keyframes you want to create and then those are evenly distributed among the sequence. Right now you have to rate them with 1 star by hand which takes quite a bit of time if you want to have 10+ keyframes for day to night sequence .

Quote from: dmilligan on October 22, 2013, 11:41:55 PMGood idea, thanks.
The latest version works great, so we all have to thank you! :-)

Quote from: dmilligan on October 22, 2013, 11:41:55 PMMark the frames that you don't want to be touched (used as keyframes) with 1 star. First and last selected frames are assumed to be keyframes even if not marked. Deflicker will run the histogram matching on a ramped EV target from one keyframe to the next. "Ramp All ACR Settings" works basically the same way, except just blindly ramping all settings from one keyframe to the next.
When shooting with Nikon in manual mode and adjusting exposure along a sunset/rise you don't have any flickering (except natural light flicker) if you use a manual lens apart from the obvious jumps in brightness. Could you implement a special mode for that where the two adjacent are just matched (pull down the brighter frame by half of the difference in EV and push the darker one by the same amount) and the rest is adjusted accordingly to the surrounding keyframes? Could they be detected based on metadata?
That is why I suggested to mark them with 2 and 3 stars for the first and second image of those pairs. According to my experience with deflickering that is based on image content you can only make it worse if you have perfect source material.

Deflickering works on the histogram of the preview thumbnails that are extracted based on the current .xmp settings, right? Is it a problem if I use a super flat profile like this, if yes could you make it more robust?

Could the deflickering be sped up by working on lower resolution DNGs of the same images? That would be great since you store the DNG and original RAW files in the folder with just one .xmp file for each pair of images (or you just copy the .xmp files to another folder if the DNG and RAW file have the same name).

Would it be possible to have the deflickering only using certain parts of the frame?
The reason is that for example you want to have the shadows or general foreground flickerfree, since you don't care about the sky as much or vice versa (or you want to to deflicker them separately and merge them later in AE for ultimate smoothness).
Would it be possible to have preview window where I can draw a rectangle that specifies where the brightness is measured? If yes, could that area also be animated (for motion control shots where the camera rotates/pans)?

Could the multi-pass deflickering for best precision be automated?
With a dialogue where you select the amount of passes (you mentioned somewhere more than 3 is not necessary) and maybe a second input field for the line skipping of the last pass (if necessary, I still don't understand how that works -see below), it then does everything by itself and purges the cache automatically between the passes (I know I'll forget that half of the time...). 

What exactly does percentile do?
How does the "Line Skip" work? Does it skip lines in the histogram?
What is preview under deflickering supposed to do? I get nothing when I press it.

Any chance to get those animated gradients I mentioned? That would be tremendously useful for sunsets, milkyway and dolly shots. If you do that please implement the possibility to ramp more than one (3 linear and 2 radial ones should be more than sufficient)

Is it possible to adapt your script to stereoscopic sequences (especially the deflickering!)?

I am not sure if it is necessary, but commercial software initalises the .xmp files before working on them, I think it does that because otherwise it doesn't work reliably, for the gradients mentioned above it is probably necessary. I am not sure if you know that or if that information is of any use for you, but I thought I'd mention it.
Creating keyframes and the initialisation could also be combined into one dialogue.

Quote from: dmilligan on October 25, 2013, 01:24:43 AM
Renamed 'Ramp All ACR Settings" to 'Ramp Multiple...' and added option to select which things to ramp (like the ACR dialog when you select 'Synchronize...').
Just a suggestion for better usability - maybe you could create tabs or divide them another way like they are arranged in the Camera Raw Dialogue? Also check groups additionally to single checkboxes.
The FX-Vignetting could be added aswell for the sake of completeness (Grain is useless since it generates a static noise pattern).
The checkboxes for the colour adjustments are a bit random, why don't you order them by the name of the colour and and Hue/Sat/Lum (for example "Aqua Hue, Aqua Saturation, Aqua Luminosity")
Could you add ramping for the curves too?


Quote from: dmilligan on October 21, 2013, 02:14:56 PM
I decided to go with Br instead (hence the script I created), it's much faster. AE takes several seconds to render a RAW frame, even on low quality (this is so annoying, why adobe why?!), Br has some kind of fast preview mode that takes fractions of a second. It's just much easier and faster to do in Br.
I hope you don't mind that I pulled that quote into this thread, it seems to fit better in here.
I would love to have everything in AE instead of going back and forth between it and Bridge. Can you call Bridge from within AE for the .xmp stuff? Deflickering would take as long as full length render time of sequence (meaning hours) if done entirely in AE...
Maybe you could consider it again once the Bridge script is more mature?


Bug report (though only a minor one):
The last digit of the amount of selected images is cut in half verticaly (meaning the right half is not displayed).


Thanks for your time and keep up the good work!

Is there way to tip you for all your effort so far? I would be happy to do that if you keep the script under GPL. :-)