Center filters in Adobe?

Started by svedosh, December 02, 2014, 05:31:30 pm

svedosh

Has anyone figured out how to create a center filter effect in adobe?

It would require using the gradient tool along a circular axis. Ideally the user would input the number of stops that the center should be darkened, and then the tool would scale that using a cosine function out to the edge.

Essentially we need to compute a darkening coefficient for every pixel based on it's distance from the center. If the diameter of the image circle is D, and if the coefficient at the center of the circle is C, then the coefficient at distance r = COS((D-r)/D) * PI/2). I'm not sure how to derive the value of C from the # of stops associated with the filter, but if you shoot a white sheet you can trial-and-error the solution pretty quickly.

Does this exist? If not, are any hot programmers interested in creating a digital alternative to center filters? They are expensive and a nuisance. I would happily pay for software that solved this problem.

langier

December 02, 2014, 05:49:05 pm #1 Last Edit: December 02, 2014, 05:51:04 pm by langier
I usually want to go the opposite way and darken my corners and edges...

In ACR I would think it would be a matter of playing with the Vignetting settings. The slider will both lighten and darken your corners and allows both some minimal shaping and sizing of the ramps.

For PS, you could use an adjustment layer set to Screen and then use a radial gradient and eyeball your adjustments. For some lenses, it may take a couple of layers since what I was taught is that each Screen or Multiply layer is roughly one-stop lighter or darker. To fine-tune the layer, it is then a simple matter of lowering the opacity to lessen the effect.

I had to use a radial gradation on a screen layer today to lighten the corners of an image I was digitizing.

I'm sure there would be a way to translate all the math to the n-th degree, but nobody cares about the math after the ink hits the paper!
Larry Angier
ASMP, ACT, & many more! @sacred_icons, @thirty9co
https://angier-fox.photoshelter.com

kirkt

December 02, 2014, 07:42:32 pm #2 Last Edit: December 02, 2014, 07:53:35 pm by kirkt
I'm not sure exactly what you are looking for (in terms of implementation).  You can use normalized image dimensions between 0 and 1, and enter a amply spaced array of these dimensions in Excel or whatever, and solve for the cosine as a function of location.  Then convert the resulting cosines (ranging between 0 and 1) to RGB between 0 and 255.  Go into the gradient editor and enter each RGB value (same value for R, G and B) at each location on the gradient (the gradient location is in percent, or normalized location).  For example, see attached images.  When you make your gradient, set smoothness to "100".  Enter your normalized location values as percentages in the "location" field.  For each gradient stop, enter the RGB values (all the same) in the RGB fields of the color picker dialog.

I would use the following slightly convoluted but flexible implementation:

1) open your raw file in PS as a SMART OBJECT with the "base" exposure (the standard exposure, not darkened with negative exposure compensation).
2) open a second copy of your raw file in PS as a SMART OBJECT with your peak negative exposure compensation.
3) layer the negative exposure comp Smart Object over the base Smart Object.
4) apply the cosine gradient as a mask to the exposure compensation Smart Object.

This way you can adjust the exposure compensation of the raw file by re-editing the smart object.  However, you may want to play with the Process Version of the exposure compensation Smart Object to get a straightforward exposure adjustment, versus an auto-ranging highlight compression exposure adjustment of the PV2012 raw converter.

If you try to apply an exposure adjustment layer, it may not give you the desired effect.

Nothing fancy.  Maybe it will work?

In ACR there is a radial gradient tool - you could set the feathering and exposure compensation and get pretty close to a cosine function, if you chose to burn the effect into your raw conversion.

kirk


kirkt

Here is an example image with the two Smart Object layers, exposure compensation on the top Smart Object and the cosine mask applied to modulate the top Smart Object.  Also attached is the grayscale profile of the cosine gradient mask, as plotted in ImageJ.

kirk

svedosh

Brilliant. Pretty much exactly what I was looking for. Now I need to try it myself. Thanks.

kirkt

You're welcome.  I hope it works for you.

kirk

Bart_van_der_Wolf

Quote from: svedosh on December 02, 2014, 05:31:30 pm
Has anyone figured out how to create a center filter effect in adobe?

It would require using the gradient tool along a circular axis. Ideally the user would input the number of stops that the center should be darkened, and then the tool would scale that using a cosine function out to the edge.


Hi,

To really correct for the somewhat Cosine like fall-off, it needs to be applied to linear gamma image data, preferably before Raw conversion. It is also not necessarily a pure Cosine fall-off, and it varies depending on lens design, aperture, and focus distance.

The simple yet accurate approach would be to use something like a Lens Cast Calibration (LCC) procedure and an additional LCC shot through a opal/diffuse filter. Lightroom has an experimental plugin from Adobe available, Photoshop would require a more involved programming effort to achieve something close to accurate for luminance and color.

Cheers,
Bart
== If you do what you did, you'll get what you got. ==

kirkt

I agree Bart.

I did not even want to bring up the linear part.  That's partly why I mentioned that using an Exposure adjustment layer in PS would not necessarily give you the effect the OP would be looking for.

My proposed approach is a kludge that might look ok.

kirk

svedosh

I confess that you lost me with linear gamma.

Ok. here's the root problem. I'm still shooting on film with my beloved Master Technika, and the work flow passes through an Imacon and a desk top before heading to the client. Subjects are building interiors and exteriors (unless I'm shooting for my own pleasure), so uniform lighting is important. I respect the view of art photographers who like darkened corners; I can't live with it. I dropped the old Schneider 3c center filter for the 47XL lens, and they don't make any more. None on ebay or any of the usual haunts. So I'm trying to recreate it digitally.

I can't get a 3c filter (2 stops at center image) but I can get a 3b (1.5 stops). So what's the pro consensus as to the least evil? Shoot with the wrong filter or correct with the wrong function? Or is the linear gamma solution an option?

Schewe

Quote from: svedosh on December 02, 2014, 05:31:30 pm
Has anyone figured out how to create a center filter effect in adobe?


Camera Raw in Photoshop CC has a radial gradient tool. Should be able to do what you want...

FranciscoDisilvestro

Hi, I would suggest to follow Bart's recommendation and learn to use the Lens Cast Callibration tool or equivalent.

Since you use a technical camera, you have the additional issue of the position of the optical axis of the lens (unless you don't use any movements), which makes it very difficult to use a software filter.

For best results, you will need to take a LCC shot with the same movements (shifts / swings) as the image you want to correct

Regards

kirkt

Quote from: svedosh on December 03, 2014, 01:42:32 pm
I confess that you lost me with linear gamma.

Ok. here's the root problem. I'm still shooting on film with my beloved Master Technika, and the work flow passes through an Imacon and a desk top before heading to the client. Subjects are building interiors and exteriors (unless I'm shooting for my own pleasure), so uniform lighting is important. I respect the view of art photographers who like darkened corners; I can't live with it. I dropped the old Schneider 3c center filter for the 47XL lens, and they don't make any more. None on ebay or any of the usual haunts. So I'm trying to recreate it digitally.

I can't get a 3c filter (2 stops at center image) but I can get a 3b (1.5 stops). So what's the pro consensus as to the least evil? Shoot with the wrong filter or correct with the wrong function? Or is the linear gamma solution an option?


I do not know how the workflow is complicated by film and negative or film scanning, etc.  My (incorrect) assumption was that you were shooting raw.  I apologize.  The linear gamma comment was basically dealing with a doubling of pixel intensity corresponding to a stop of exposure - this pertains to a linear image that does not have a gamma correction applied.

kirk

jfwfoto

I just created a new file in photoshop and took it to camera raw for the vignetting and adjusted with clarity and contrast. Back to PS and inverted it for use in PS layer mask in luminosity mode. I am not much of a PS guy but it looks like it could work.

tony field

Since you are using a 4x5 camera with a 47mm lens, you probably do not use any swings and tilts.  This might be a way to solve the problem digitally.

The first step is to make a "mask frame" using the same (I assume colour) film that you normally shoot with. Using B&W for this mask frame might be acceptable but you may need to adjust the contrast slightly in photoshop if your real image is in colour.  If you are using different lenses, say a 90mm with swings and tilts, it might be necessary to always take a mask reference frame.  If the lens such as the 47mm has different light fall-off at different apertures, you might need to create a few mask frames at different apertures.

Take a single frame of a uniformly lit large white card - possibly a 3 foot by 4 foot white foam core board.  Put the card reasonable close to the lens to ensure that it is quite out of focus to remove any of the white board surface texture - probably set the lens for infinity focus or at least your real subject's normal working distance.  Expose should be for reflected light middle grey (i.e. believe your reflected light meter - however an incident light meter should work just as well :) )  I think the 18% metering is correct in that it is in the centre of your film's characteristic curve and therefore is not affected by the shape of the top or bottom of the H&D curve.

After you scan this mask frame image, you can now use it as a gradient to darken the centre or lighten the edges. 

The "mask frame" should be converted to B&W.  If there is any surface texture from the white board still showing, use the minimal radius Gaussian blur that will remove this unwanted detail.  It (hopefully) will not cause any noticeable change to the gradient of the mask frame.  If the mask frame white target was not perfectly uniformly light, the minor corrections to the mask can be made in photoshop.

Load your "real image" as the background layer.

Load your "B&W mask frame" above the background.

Since the mask frame was exposed for 18% grey, it will be overall too dark.  Therefore adjust the layer opacity to some small value (i.e. 5% or what ever seems reasonable)

Depending upon which blend mode you use (such as Subtract, Soft light, Lighten, etc), you need to invert the mask frame layer or not.

(( I tested this process "in principle" in Photoshop ... it seems to work  ... basically, it is just a variation of vignetting.  I am assuming that the process will work in the real world :)  ))