Bart's Notebook | Bart's Photography Notebook | Bart's Retouching Notebook

Sunday, June 18, 2006

Photoshop Helper Actions (PF updated V2.6)

I have three Photoshop actions which were tweaked to work with the Fuji F30, but they'll often work with any camera.


Updates:
2006-December-23 update: I now have three separate files for the three actions. Here they are:

Purple Fringe Remover. Works on Photoshop 7, CS, CS2, CS3, and Photoshop Elements 1, 2, and 3.

Radial Sharpen. Works on Photoshop CS2 and CS3.

Anti-Flare. Works on Photoshop CS2 and CS3.

The only functional update this time is to the purple fringe removing action which has been updated to work with Photoshop Elements 3.0 or earlier (I don't know if it'll work in newer versions of Elements.) I think it should also be a bit more robust for older versions of Photoshop (v7 is the oldest I know it works on.)

Anybody who tests these successfully on something else, let me know.


Photoshop installation (windows)
Photoshop users only need to copy the .atn files into their action folder then load the action into photoshop. Barts_PF_Remove_v2_6.zip also contains a file called "Barts PF Remove v2.6.psd". You can delete the this file as it's not needed for Photoshop. Restart photoshop to use the actions.


Photoshop Elements installation (windows)
Step 1:
Make sure to shutdown Photoshop Elements.
Unzip Barts_PF_Remove_v2_6.zip. There are two files called:
Barts PF Remove v2.6.atn
Barts PF Remove v2.6.psd

Step 2:
Go to path
c:\Program Files\Adobe\Photoshop Elements 3.0\Previews\Effects
and create a folder called "Barts PF Remove". Copy the two files from step 1 into this folder.

Step 3:
Go to path
c:\Program Files\Adobe\Photoshop Elements 3.0\Previews
and delete the folder called "Cache".

Step 4:
Restart elements. Because you deleted the Cache folder, give it a minute to populate the effects palette. When it's all done, you should be able to see the icon for the PF remover in the palette. It looks like this:


All you have to do now is load an image and double click this icon and cross your fingers. FYI, I have adapted the procedure found here:
http://www.hiddenelements.com/actions_whitepaper.htm

Consequently I don't know if it'll work on Photoshop Elements 4.0 or newer.


Just an FYI about opertion--if you run the purple fringe removing action on an image that has very little PF, you'll get a warning dialog saying something like "warning, no pixels more than 50% selection". Just click the OK button and the action will complete properly. If you run the action on an image with NO purple fringing at all (eg., run it on an image that's all one color) you'll get some more warnings about no pixels being selected and some commands not being available. In this case, you might as well "stop" the action because this means it's finding no purple fringing at all.

Photoshop Elements users can try this link--there are some free addons for Elements to allow it to run actions (I have not personally tried it.)


Purple Fringing:
download now
The first one removes purple fringing and is called "PF Remove". It's based on a radial model of purple fringing--ie., the purple fringing radiates away from the center of the image getting worse as you approach the edges (this is how purple fringing behaves in all three digital cameras I've owned.) It's also based on contrast changes of course, so there are situations where it will accidentally remove purple where it shouldn't. It's meant primarly for those situations where you have darkish foreground objects set against a bright sky, but it'll work for a variety of situations (see examples below). When you run it, keep in mind you can erase its effects in regions of the photo you know won't have any purple fringing. I fixed the problem in V1.0 that devoured color around clouds. The only errors I've seen are that it will miss some subtle forms of PF (which are hard to see anyway) and it'll attack the edges of purple flowers (kind of hard to avoid).

One other thing--you must run it only on un-cropped photos. This is because the radial modelling of the lens assumes the entire original photo is present. Photos can be scaled in size, but not cropped.

Here's a typical before/after situation where you have some purple fringing on some foliage and sky in the background (click on the image to see the 100% crop). The crop is done after running PF remove of course.



So you can see the action has removed the purple. You might also be able to see another cool feature on this action and that is it put the green back where the purple was. It's hard to tell because the foliage is low saturation, but you'll see the difference if you turn off the "PF Replace Color" layer (see below).

When you run the action, it creates two new layers. No changes are made to existing layers! So you can always undo the effect by delete these two new layers. An example of these layers is shown here:



The first layer is a Hue/Saturation adjustment layer labelled "PF Removed". The mask on this layer designates the areas of the image that have dark-to-light contrast changes radiating from the center of the image plus some allowance for flare (which is omni-directional). Any purple in the white parts of the mask gets removed (desaturated.) The purple fringing on the Fuji F30 is really PURPLE. This Hue/Saturation layer is targeting that color. If you have a different model of camera with a different color of purple (ie., many camera's have PF that is more blue), then you can fiddle with this adjustment layer (or, better yet, fiddle with the appropriate step in the action) to customize it for your camera.

The second layer is an image layer called "PF Replace Color". This layer will usually look mostly transparent, but if you look at it closely, you'll see it has some non-transparent information on it. The blend mode of this layer is "color" and it is the layer that's replacing the color that belongs where the purple used to be. You can manually paint on this layer to do any further color fixes (for instance, any purple that wasn't removed or any colors that weren't properly replaced.) This layer also shows you exactly where purple was removed so you can make sure no desired purple was removed. You can turn off this layer to see how it would look without the color replacement.


Radial Sharpen--improves lens edge softness
download now
Most P&S cameras have this at some focal lengths to one degree or another. My Z750 has it pretty noticeably in full zoom. The F30 has a slight amount at full wide angle. If you want to get rid of it, I have an action that'll do it--it's called "Lens Sharpen". This action sharpens in the radial direction progressively more as you move away from the center of the image--so you need to run it on un-cropped images (resized is okay.) I tuned it primarly for 8mm focal length (full wide) on the F30 which is far and away the most common zoom setting I use. In the case of the F30, I think the edge softness of that camera is mostly in the radial direction. I think this is at least partly because Fuji corrects barrel distortion in the camera which tends to stretch, and therefore soften the edges in the radial direction.

When this action runs, it creates a special type of unsharp mask layer that is sharpening in only the radial direction with progressively larger radius as you approach the edges. So it has no effect near the center of your image. By default, the opacity is at 30% because that seems to look good. (Note that the blend mode is linear light.) You can change the opacity to increase or decrease the edge sharpness to taste. The sharpening layer is called "Radial Sharpening".


Mega-blow out flare
download now
There's a third problem I come across more rarely than purple fringing that occurs when the dynamic range of the scene is huge--ie very dark foreground and very bright background. I'll call it lens flare, but it can also be a function of the CCD. It can be minimized by turning down the in-camera contrast, but the F30 unfortunately has no way to turn down contrast and the F30 seems more extreme than other cameras--at least more so than my Casio Z750. I've encountered the problem infrequently enough that I haven't had a chance to test this action very much. The action I use to help remove this problem is called "Anti-Flare".

Here's a crop from a photo that has this problem in a small area:


The flare from the bright sky is obscuring the leaves. When you run the script, it creates two new layers similarly to the PF remove script:


The first layer is called "Anti-Flare Curve". This is controlling the strength of the anti-flare effect. Photoshop users can adjust the curve itself to fine-tune the effect for the specific situation which can be quite variable. I don't think Photoshop Elements will allow you to actually adjust the curve, so you may have to just adjust the opacity of that layer. Here's the result for our example.


Not perfect, but good enough. The second layer created by the action is called "Anti-Flare Replace Color". I just sampled some nearby leaf colors and painted sloppily in the flare location to put the green back in:

11 comments:

Aravind Krishnaswamy said...

Good stuff! Thanks for posting these, can't wait to try it out.

John said...

Bart, how do you get the PR action to work in Adobe PS Elements 4? The Adobe forums show it isn't easy and I was unable to get it to work.
In PSE4 there is no Photoshop Actions folder. Creating one wasn't productive.
Thanks for any help,
John

btw as a dpreview fuji forums lurker I've appreciated you suggestions for the F30

Glenn2 said...

Hi Bart - great work.
I've tried Shay Stephens PF remover and I'd like to try yours too as it looks better.
Is it compatible with Photoshop6? I can't make it work. Something about object layers being unavailable. (Using PS6 on Win XP Home, SP2)
Thanks.

Anonymous said...

Bart:
I really like your PF Remove action. Any updates since v2.3?
I can't say that I am anxiously waiting for an improved version, as the current one works like a charm on images from my Canon A95. They are now 99% fringe-free, and that's a fact.
Thank you!
Mike Lee

Bart Hickman said...

Glad to hear it! I wasn't going to improve the performance as it works pretty well already, but it is on my to-do list to figure out how to make it work with older versions of photoshop and maybe also photoshop elements.

Anonymous said...

Thanks, Bart! This action works very well with the F30. I really appreciate you sharing it!
I especially think the color selection of the replacement colors is a great feature.
Thanks again,
David

Anonymous said...

Bart:
I've downloaded v2.4 and would very much like to "...fiddle with the appropriate step in the action to customize it for your camera." Looking at ALL the action steps I'm not sure which one I would modify to tweak it for my color "purple". Help please.
Mike Lee

Bart Hickman said...

Mike,

When the action is done, there's a layer called "PF Removed"--it's a H/S adjustment layer. That's the layer that's actually removing/changing the color.

Open up this layer and select the "blues" from the pulldown. You'll see the color range that is being altered as well as the amount it is being altered. Play around with the adjustments to get the result you're after.

Once you've changed the H/S layer the way you want it, make a note of the changes and close it with the cancel button. Then make sure you have it selected in the layer palette. Then open the action and select the step named "set current layer" 10 steps up from the bottom. Click the record button, open the H/S layer again, make the changes you noted, then click okay. Stop recording. That's it.

You can simply disable this step to go back to default or alter it to change the color.

Bart

Anonymous said...

Bart:

I wasn't really expecting much (if any) improvement, but I was wrong. Using the color picker I tweaked my "purple" more towards blue and now notice a slight but definite reduction in "residual" fringing. Without tweaking I would have been (and was) completely happy with the results. I'm glad I followed your suggestion to customize the action for my camera.

I'm promoting your action to fellow members in my local camera club.
Thanks again.

Mike Lee

grichardanderson said...

Bart, thanks so much for creating and sharing this information. my Fujifilm S100fs has a terrible problem with PF and your action improved my images so efficiently and quickly. my client and printer were both very pleased. i will continue to check in with you for your photography and insights.

Anonymous said...

I found this page "hunting" for better ways to remove PF. Well, after a dozen or so of PF removing actions found on the net, all I can say is THANK YOU SO MUCH! This is the real deal. Thank you again, Bart!