• Home
  • About
  • The Blog
  • Galleries
    • Ithaca Waterfalls
    • Scene Around The House
    • Fabrications
  • Contact

Paul Duncan

~ photography and other stuff

Monthly Archives: November 2015

Vignetting 6: Other Options and Summary

21 Saturday Nov 2015

Posted by Paul Duncan in Photography

≈ Comments Off on Vignetting 6: Other Options and Summary

  • Vignetting 1: Overview
  • Vignetting 2: Parametric Correction
  • Vignetting 3: Correction Images
  • Vignetting 4: Photoshop Divide Layer
  • Vignetting 5: A Pathological Example
  • Vignetting 6: Other Options and Summary (this post)

For a little perspective on what we’ve been dealing with, we can posterize high-contrast versions of our flat fields to better appreciate the topology of vignetting in different circumstances:

Posterized high-contrast flat field images

A little processing can enhance the features of flat field images to visualize their contours more easily. Contrast was boosted and the images posterized to get this effect.

Far from exhausting the possibilities for vignetting correction in this series of posts, there are many other options to consider.  Here are a few:

Capture One Pro

If you are using Phase One’s excellent Capture One Pro to process your images, the Lens Correction Tab includes tools to not only correct images for lenses in their database but you can create and apply LCCs (Lens Cast Calibration) images.  It uses flat field images like we’ve been talking about, to enable you to selectively correct for Color Cast, Dust Removal, or Enable Uniform Light in any combination. It works really well. The tab also includes the more conventional parametric sliders for vignetting.

Hugin

Hugin is freely-available panorama stitching software that has a number of tools available for image corrections.  The fulla command-line tool in the package enables a couple of different ways to address vignetting.  One way is to use the –flatfield command line option to specify a flat-field image used for a division operation very similar to what we did using ImageMagick commands in an earlier post.

Another option offered in fulla is the –vignette command-line option used to specify 4 coefficients for a 6th-order polynomial describing the fall-off curve for radially-symmetric vignetting.  I’ve used it, it works quite well, but it’s probably not for anyone who recoiled when I mentioned 6th-order polynomial coefficients.

Video

Although possibly worthy of another entire post, it should be mentioned that vignetting can be corrected for video in a number of ways too.  Besides the usual parametric slider corrections, Adobe After Effects, for example, provides layer blending modes.  You can use the same techniques we’ve been discussing to create a correction layer above a clip and change the blending mode to Divide or Multiply, as we’ve previously demonstrated with Photoshop, to get accurate vignetting control.

Vignetting Perspective

Contrary to what a 6-part blog series on destroying vignetting might indicate, I don’t have a visceral hatred of vignetting. But vignetting is a consequence of the camera, lens, and settings you use; it’s not a characteristic of the subject you’re shooting. I generally don’t want it to be a noticeable component of an image unless there’s a specific reason for it. Maybe adding some judicious vignetting to an image can improve it but that added vignetting is likely to be of different character and magnitude than the system’s innate vignetting.  Vignetting often seems gimmicky and detracts from an image but at least there are techniques available to fully control it on your terms.

Bogus Alert

There are, like anything else, numerous explanations, tutorials, and remedies on the Internet that address vignetting.  Some are even accurate.  Much is (possibly well-intentioned) bad advice.  For example, there are discussions here and there about creating radial gradients and applying them in layers using Multiply or whatever.  These are often accompanied by some hand-waving about tuning with opacity adjustments etc. (to disguise the damage done to the image). Ignore all that.  Radial gradients are linear by nature and, as we’ve seen, real-world vignetting is not linear at all.  Making a linear adjustment to an exponential problem just shoves pixel values around, improving one thing, creating problems elsewhere.  Bogus, bogus, bogus.  If you want quick and easy, stick with parametric vignetting adjustments common in almost all image processing software.

Summary

There are a few high-level lessons I’ve learned about vignetting and vignette control.

  • The best, most accurate, vignetting adjustment is enabled by your creation of good flat field images.  Those flat fields can then be used to either determine the optimal settings for parametric slider adjustments or can be converted to highly-accurate correction images themselves.
  • For radially-symmetric vignetting (the most common case) optimal parametric settings are usually “good enough”, creating results that the eye is quite satisfied with.
  • For most accurate results, or for the occasional oddball non-radially-symmetric case, flat field correction images are the way to go.  They can be used in a number of tools in different ways:  command-line manipulation in ImageMagick and layer blending modes in Photoshop being two we focused on.  (Under the covers they’re doing the same thing.)
  • There’s still a lot more we haven’t covered in this series but we have covered some solid tools to address the most common problems.  There’s little practical need to get any deeper into this swamp than we already have.

 

Vignetting 5: A Pathological Example

21 Saturday Nov 2015

Posted by Paul Duncan in Photography

≈ Comments Off on Vignetting 5: A Pathological Example

  • Vignetting 1: Overview
  • Vignetting 2: Parametric Correction
  • Vignetting 3: Correction Images
  • Vignetting 4: Photoshop Divide Layer
  • Vignetting 5: A Pathological Example (this post)
  • Vignetting 6: Other Options and Summary

There are cases where vignetting is not radially symmetrical like the examples shown so far.  Those cases cannot be fixed with parametric vignetting adjustments such as those in Lightroom or Photoshop.  They are, however, handled nicely by the use of correction flats.

As an example, here’s an image shot with a Panasonic GH4 and Lumix 20mm lens at f/2 (which we’ve been using for our examples all along).  But in this case a Singh-Ray variable neutral density filter is on the lens as well.  The max. setting for the filter does strange things to the luminance distribution for any image.

Abnormal light fall-off characteristics are evident in this image shot with a Singh-Ray variable neutral density filter.

Abnormal light fall-off characteristics are evident in this image shot with a Singh-Ray variable neutral density filter.

The abnormal darkening of the sky at upper right is clearly evident.  The lower left of the field is very dark as well.  Upper left and lower right seem to be okay.

Shooting a flat field image with this equipment combination shows the odd asymmetric fall-off effect caused by the ND filter on this camera.

Lumix 20mm f/2 with Singh-Ray variable ND filter at Max.

Flat field image shot with a Panasonic GH4, Lumix 20mm lens at f/2 and Singh-Ray variable neutral density filter at Max.

A graph of intensities along each of the four diagonals running from center to corners gives another view of this mess.

graph of effect of ND filter on flat field

The Lumix 20mm lens at f/2 with a Singh-Ray ND filter at the max. setting shows very asymmetric luminance curves in the flat frame.

Note how the brightest areas are about ¾ of the way along the upper right and lower left diagonals in the graph, not the center like the more typical vignetting curves we’ve shown.

It’s obvious that the usual parametric slider vignette controls in Lightroom couldn’t possibly deal with this odd luminance profile.  However, our flat field correction approach, either using ImageMagick or Photoshop, can handle this with little trouble.  Using the Photoshop Divide blending layer approach we described previously, we get good correction for this pathological case.

Image with vignetting corrected

A Photoshop Divide blending mode layer was used to correct the abnormal vignetting.

The moral of the story: pick the right tool for the job.  You may think another moral of the story is not to use Singh-Ray neutral density filters at Max. setting.  But once you know how to adjust for the side effects, it’s not an issue.  Variable neutral density filters are very useful when shooting video and we don’t want to restrict ourselves when we have a workable solution for odd fall-off effects in different equipment and shooting configurations.

Vignetting 4: Photoshop Divide Layer

20 Friday Nov 2015

Posted by Paul Duncan in Photography

≈ Comments Off on Vignetting 4: Photoshop Divide Layer

  • Vignetting 1: Overview
  • Vignetting 2: Parametric Correction
  • Vignetting 3: Correction Images
  • Vignetting 4: Photoshop Divide Layer (this post)
  • Vignetting 5: A Pathological Example
  • Vignetting 6: Other Options and Summary

In the previous post we discussed converting a flat field image into a correction image which we then apply, using a divide operation, to remove vignetting.  The technique used several ImageMagick commands.  We can accomplish the same thing in Photoshop: it’s a simple sequence of steps which, under the covers, does the same thing we did with the ImageMagick approach.

For this description we’re using Photoshop CC 2015.  Other versions may have some differences.  We’re going to do the same two things we did in the ImageMagick procedure, except using Photoshop layers rather than command-line options:

  1. Create a correction image by dividing each pixel value by a factor that scales the brightest pixels up to a value of 1 and all other pixels scaled up proportionally. (We’ll use a Levels adjustment to do this.)
  2. Use the correction image to divide into the subject image to correct the brightness levels to remove vignetting. (We’ll use a Divide blending mode layer for this.)

Create A Correction Image

We’re going to create a correction image from our flat-field image that we can then use to remove vignetting on any image shot with the same camera/lens/filter/aperture combination.

  1. Open the flat field image in Photoshop.
  2. Add a Levels Adjustment Layer.
  3. In the Levels control, hold down the alt key and move the highlight (white) triangle slider left toward the histogram mass of the flat field image.  Keep an eye on the image and stop just when the totally black image starts showing some brightness levels.  The slider will be just touching the right edge of the histogram’s non-zero values.Photoshop Levels adjustment
  4. Flatten the image and save it as an uncompressed TIFF file.  This is your new correction image which you’ll use to correct vignetting in other images.

Add a Correction Layer

Correcting vignetting in a subject image is simple with a properly-prepared correction image available.  We’re just going to add the correction image as a layer above the subject (Background) image and change the blend mode.

  1. Open the subject image in Photoshop.
  2. Click File, then Place Embedded… and select the correction image you prepared previously.  Click Enter to accept the placed image. This adds the correction image as a layer above the subject Background image.
  3. Change the layer blending mode of the correction image layer to Divide.  You’re done.  Save the image.
A Photoshop correction image layer uses the Divide blend mode to remove vignetting from the subject image.

A Photoshop correction image layer uses the Divide blending mode to remove vignetting from the subject image.

The Results

Applying the correction Divide layer to our vignetted flat field test case yields excellent results, as expected after what we experienced doing the same thing with ImageMagick previously.

Using a Divide layer correction in Photoshop removes vignetting from the test flat field image.

Using a Divide layer correction in Photoshop removes vignetting from the test flat field image.

Statistically, the results are nearly perfect.

Photoshop Divde-layer corrected Lumix 20mm f/2 flat frame
Attribute Before After
Mean 57.69 65.89
Min 37.89 65.89
Max 66.04 66.04
Range 28.15 0.93
Standard Deviation 5.90 0.00001
vignette correction histogram for Photoshop layer method

After applying a Divide-layer correction to the flat field image, the histogram shows a perfect correction.

The histogram for the corrected flat field image looks perfect as well.

 

 

 

 

 

 

 

 

Example

An image of a brace and bit on a concrete floor is plain enough that vignetting, and its correction are readily apparent.

Brace and bit with obvious vignetting
Before: Lumix 20mm at f/2 shows signficant vignetting.
Photoshop layer-corrected vignetting
After: in Photoshop, a correction frame is placed above the subject image using Divide blend mode.

The Multiply Alternative

The process described above corrects vignetting by lightening the parts of the image that suffered fall-off, reversing the darkening that becomes more prominent farther from the center of the image.   Another way to address the problem is to darken the center portion to bring the levels down proportional to the corner levels.  This is usually not the preferred choice but there may be circumstances where this alternative is preferable.  For example, raising levels toward the corners may blow out important highlights that you wish to preserve so the darkening approach may be called for.

Briefly, here is how to darken lighter portions rather than lighten darker portions to correct vignetting.  First, you will want to create your correction flat differently than the original approach.  Invert the flat field image first, then add a Levels correction layer, click Alt, and move the white slider left until you start to see non-black regions in the image showing.  (This time it will be the corners rather than the center because you inverted the image.)  Save the correction image as an uncompressed TIFF file.

To apply the correction using this inverted correction flat, load the subject image, then load the correction image as a layer above it.  Change the blending mode of the correction layer to Multiply.  That will cause the lighter central region to darken in line with the corner regions, removing the vignetting.  This darkens the overall appearance of the image so another adjustment may be required to bring the levels back up to where you want them.

Here’s a comparison of the Divide blending mode correction (raising darker tones) and the Multiply blending mode correction (lowering lighter tones):

Photoshop layer-corrected vignetting
After: in Photoshop, a correction frame is placed above the subject image using Divide blend mode.
Brace and bit with augers
After: using a Multiply blending mode with an inverted correction layer darkens lighter areas, preserving darker areas.

Although equally effective at removing vignetting, clearly the Divide blending mode layer technique yields a better overall tonal result, as it will in most cases.

Vignetting 3: Correction Images

19 Thursday Nov 2015

Posted by Paul Duncan in Photography

≈ Comments Off on Vignetting 3: Correction Images

  • Vignetting 1: Overview
  • Vignetting 2: Parametric Correction
  • Vignetting 3: Correction Images (this post)
  • Vignetting 4: Photoshop Divide Layer
  • Vignetting 5: A Pathological Example
  • Vignetting 6: Other Options and Summary

When we’ve gone to the trouble of making a flat field image for a given system configuration and aperture, there are several ways the flat frame can be used to correct vignetting in other images shot with the same configuration and aperture.

Using ImageMagick (version  6.9.2-5 Q16 x64 for this example) is one way to do our processing.  ImageMagick is a suite of image processing tools with the advantages of price, power, and precision. The price is right: it’s free.  It’s very powerful with a rich set of commands and options covering a broad range of capabilities.  It is very detailed in reporting information about an image and enables precision with its robust option set.  It lends itself well to automation scripting for large jobs.  APIs are available for a variety of programming and scripting languages.

The Concept

The goal is to exploit the flat field image to correct the vignetting that it manifests itself.  This will precisely control the adjustments of the pixel values.  Unlike the parametric control technique, this method can correct nearly any type of intensity anomalies including more complex fall-off patterns that are not radially symmetric.

To understand how and why this works, it is helpful to think of the pixel intensity values falling in a range of 0 to 1, where 0 is pure black and 1 is white, the greatest possible pixel value.  All other tonal values are represented by some fractional value between 0 and 1.  This is, in fact, how ImageMagick and Photoshop perform some of their calculations under the covers.

The following discussion is simplified by ignoring multiple channels.  We’ll look at a single channel, understanding that the same exact mechanism and process applies to all channels.

Imagine we’re correcting the vignetted flat field image.  We want a process that will convert the varying flat field pixel levels to a uniform single tonality across the entire image (or restated, we want to remove the vignetting or light fall-off).  We want to do this in a way that the lightest pixels in our flat field are left alone and the darker pixels are adjusted up to be that brightest level.  For typical vignetting, this means we want to leave the central brighter values alone while boosting the darker levels toward the edges and corners.

flat field luminance correction

Every pixel value in a vignetted flat field is divided by a corresponding pixel value in a correction frame so that the resulting pixels are all at the same value. The trick is creating a correction frame that can do that.

For every pixel in the flat field image, we’ll have a corresponding pixel in the correction frame.  That corresponding correction pixel will have a value (also between 0 and 1.0)  such that when it is divided into the flat field pixel value, the resulting value is the target brightest level we want for the uniform corrected image result.

In the example above, the brightest pixel value is 0.9. A pixel value of 0.7 must be divided by 0.7777… (0.78) to bring it up to the target value of 0.9.  Each correction pixel value is calibrated to bring up the darker pixels in the flat field image in just the right amount.

So where do the correction values in the correction frame come from?  They are calculated from the original flat field frame.  In the example with the brightest flat field value at 0.9, we’ll divide every pixel in the entire flat field frame by 0.9 to create the correction frame.  This makes sure that the brightest values are left alone during the correction division (dividing by 1.0 in the 0.9 case) and the darker pixels are adjusted upward proportionally.

So the strategy with using correction frames is deceptively simple: create the correction frame by dividing each pixel in the flat field frame by the highest pixel value in the flat field frame; then use the correction frame on any image by dividing the input image’s pixels by corresponding correction pixels.  This correction image can be used with any image shot with the same camera, lens, filters, and f-stop that was used to shoot the flat field used to derive the correction frame.

The methods we’ll be discussing will, by default, perform these operations on all three channels in the image automatically.

Thoroughly confused yet?  It really does make sense when you think through the whole thing a few times. Okay, here’s the nutshell version of what we’re going to do:

  1. Create a correction image by dividing the flat field’s pixels by the lightest pixel value in the flat field.
  2. Correct subject image vignetting by dividing the subject image by the correction image.

Create A Correction Image

The correction image contains all the pixel values such that when divided into the corresponding subject pixels, the darker pixels are corrected to the desired value.

Using our Lumix 20mm f/2 flat field image (named vig20mmf2.tif) as an example, we first find the brightest levels in the image.

identify -format %[fx:maxima] vig20mmf2.tif

The ImageMagick identify command can display detailed information about our image including the calculated maximum level (-format %[fx:maxima]) which in this case is 0.6604.

Now we can create the correction image.

convert vig20mmf2.tif -evaluate divide 0.6604 vig20mmf2_corr.tif

The ImageMagick convert command simply divides each pixel in our flat field image by 0.6604 (-evaluate divide 0.6604) and outputs our correction image, vig20mmf2_corr.tif.

Apply The Correction Image

This correction image can then be used by another convert command to correct vignetting for any subject image shot with the Lumix 20mm at f/2.  Let’s be clever and apply this correction to our original vignetted flat field image to see how well it corrects the vignetting.

convert vig20mmf2.tif vig20mmf2_corr.tif -compose dividesrc \
          -composite vig20mmf2_IM.tif

The convert command takes several command-line options:  the subject image name (the one to be corrected), the correction image name, “-compose dividesrc” to indicate the operation we’re performing, “-composite” to perform the divide operation, and finally our output corrected file name.  (Note: the backslash is not part of the command above, just an indication that the command continues on the next line.)

One little gotcha to be aware of: if your subject image and correction image have different orientations (one is landscape oriented and the other portrait oriented), the convert command won’t adjust, the operation will divide dissimilar images, and you won’t get the results you intend. In that case, add a -rotate option for your subject image to get them both on the same orientation before it proceeds.  You rotate the output image back in post if necessary.  Here’s an example of the convert command working on a vertically oriented image with a horizontal correction frame:

convert verticalimage.tif -rotate "90<" vig20mmf2_corr.tif \
           -compose dividesrc -composite corrected.tif

See ImageMagick’s documentation for the syntax of the -rotate command-line option.

The Results

The resulting vig20mmf2_IM.tif looks indistinguishable from our ideal uniform flat field image.  The graph couldn’t look any better either:

ImageMagick correction graph

Applying a correction image to the Lumix 20mm at f/2 flat field image using ImageMagick shows an excellent resulting graph.

Finally, let’s look at the statistics for the corrected image.

ImageMagick-corrected Lumix 20mm f/2 flat frame
Attribute Before After
Mean 57.69 66.04
Min 37.89 66.04
Max 66.04 66.97
Range 28.15 0.93
Standard Deviation 5.90 0.00006

That result is within a gnat’s eyelash of perfect.  We can keep the vig20mmf2_corr.tif image and apply it any time we wish to remove vignetting from a photo shot with the Panasonic GH4 with Lumix 20mm lens at f/2.

Obviously you would need to shoot flat field images and convert them to correction images for every camera/lens/filter/aperture combination that you wish to correct in this manner.

Not So Fast

As delighted as we are at how close our correction image comes to correcting our vignetted flat field image, we have to realize we created the correction image from the flat field image so of course it looks great.  When used against other real world images, however, all kinds of variables get fired off to thwart perfection.  The correction applied this way is a very accurate but not-always-perfect way to correct vignetting.  It’s a great start, and often perfectly sufficient, but there may be shooting circumstances where the correction under- or over-compensates for the particular subject shooting conditions.  Use discretion and adjust as needed.

Example

Before: sunset rainbow image with visible vignetting. Shot with Lumix 20mm lens at f/2.
Before: sunset rainbow image with visible vignetting. Shot with Lumix 20mm lens at f/2.
rainblow landscape with vignetting removed
After: image with vignetting removed by using a corrective image applied with ImageMagick.

Using a correction image made from a vignetted flat field image shot with the Lumix 20mm lens at f/2, ImageMagick has effectively removed the vignetting.

Vignetting 2: Parametric Correction

18 Wednesday Nov 2015

Posted by Paul Duncan in Photography

≈ Comments Off on Vignetting 2: Parametric Correction

  • Vignetting 1: Overview
  • Vignetting 2: Parametric Correction (this post)
  • Vignetting 3: Correction Images
  • Vignetting 4: Photoshop Divide Layer
  • Vignetting 5: A Pathological Example
  • Vignetting 6: Other Options and Summary

In the introductory vignetting post, we showed some graphs that make it easy to see the fall-off in pixel values along a diagonal running from the center to a corner.  We can use the same technique to get some insights into how parametric vignetting correction works in various software tools.  Adobe Camera Raw, Photoshop, and Lightroom all have the parametric sliders to change vignetting characteristics.  They use two controls in tandem:  the Amount slider and the Midpoint slider.

Adobe Lightroom vignette controls

In Adobe Lightroom the parametric vignetting controls are in the Develop Module, Lens Corrections section, Manual tab.

We can run some experiments by creating an artificial perfect flat field image and trying some different control settings to see the effect.  Start with a flat field filled with uniform 50% gray.

Amount Control

When removing vignetting from an image, we move the Amount slider to the right in the plus (+) direction to lighten the periphery of the image.  We’ll try several different settings for the Amount, keeping the Midpoint at its default 50 setting.

Lightroom vignette correction amount graph

Adobe Lightroom’s vignette correction effect is graphed for fixed Midpoint (50) and varying Amount.

From this we see that when Midpoint is 50, the Amount curves only start having an effect on the pixel values starting at around 40% of the distance from the center to a corner.  The Amount effect tops out at setting 100 where it has increased the corner pixel values by about 40% of the range of possible values.

Midpoint Control

Next we try keeping the Amount fixed (at +60) and vary the Midpoint to see how it affects the curves.

Adobe Lightroom's vignette correction uses a fixed Amount (+60) and varying Midpoint. Diagonal pixel values are graphed.

Adobe Lightroom’s vignette correction uses a fixed Amount (+60) and varying Midpoint. Diagonal pixel values are graphed.

Regardless of the varying Midpoint, the effect of the Amount setting is the same at the extremes: no affect on center pixel values, and identical increases in pixel values at the very corners of the image.  The Midpoint slider changes the shape of the curve, that is it affects how the brightness adjustment gets from the center value to the corner values.

Lightroom Vignette Correction

The previous 2 graphs of how the Amount and Midpoint parametric adjustments affect the pixel levels in the flat images suggest a straight-forward strategy to correct our vignetted flat field images.  Conceptually, we want to find the two parametric settings that perform an inverse function of the vignetted image’s fall-off.  Put another way, we want to find the mirror image curve that most closely resembles the vignette curve so that the two cancel each other out.

Using Adobe Lightroom’s controls, proceed as follows (understanding that the same approach can be used in Photoshop, Camera Raw, and other similar parametric control types of corrections):

  1. Open the vignetted flat field image we want to correct in the Develop Module.  Open the Lens Corrections section so we have easy access to the vignette sliders.
  2. Mouse over the center of the image and note the green channel pixel value percentage displayed in the Histogram Pane.  (The green channel is usually the cleanest of the three channels; it’s an arbitrary choice otherwise.)
  3. Mouse over a far corner of the image and note the green channel pixel value there.  Go to the vignette Amount control and move it to the right.  The goal is to get the corner green channel value the same as the center green value we noted earlier.  Go back and forth, adjusting the Amount slider until you get the corner value matching the center value as close as you can.
  4. With the Amount setting now fixed, we mouse over a location of the image roughly two-thirds of the way from the center to the corner.  As before, we now iterate moving the Midpoint slider until we get the intermediate location’s value the same as the center value.  We should now be done finding the ideal Amount and Midpoint settings that most closely correct our vignetted flat field.

I find an alternate way to do that last step may be a bit easier: adjust the Midpoint slider keeping a close watch on the histogram as you make changes.  The goal is to get the histogram as narrow, tall, and symmetrical as possible.  We’re striving for that vertical line histogram we see in a perfect flat field.

The Results

Using this method, I found that the ideal settings for the Lumix 20mm at f/2 vignette correction are Amount +58 and Midpoint 10.  Judging by the diagonal values graph, these settings create a result with a good approximation of the ideal straight horizontal line graph we would like.

Lumix 20mm shot at f/2 has vignetting corrected using Amount 58, Midpoint 10.

Lumix 20mm shot at f/2 has vignetting corrected using Amount 58, Midpoint 10.

Statistically we get a nice improvement as well:

Lightroom-corrected flat field for Lumix 20mm at f/2
Attribute Before After
Mean 57.69 65.74
Min 37.89 63.93
Max 66.04 67.66
Range 28.15 3.73
Standard Deviation 5.90 0.45

Finally, the histogram shows a big improvement as well, getting closer to the ideal single-pixel-wide tower we would like to see:

Lightroom-corrected image histogram

After Lightroom parametric adjustment of the vignetting controls, the image’s histogram indicates a much tighter column showing a more uniform tonality.

Applying Our Results

If all we could do after this is to correct vignetted flat field images, we’ve been wasting a lot of time.  Fortunately we can directly use our results in conventional photographs.  Any time I shoot using the Panasonic GH4 camera with Lumix 20mm lens at f/2 and no filters, I can confidently apply our discovered vignette correction settings (Amount +58, Midpoint 10) and effectively rid the image of vignetting.  A crib sheet keeping a record of the flat field parametric corrections comes in handy for quick parametric corrections of images shot with the same configuration and settings.

Let’s look at an obviously vignetted image and compare the before-and-after versions.

blue sky with vignetting
Lumix 20mm shot at f/2 shows significant vignetting.
blue sky with vignetting removed
Lumix 20mm shot at f/2 with vignetting removed by Lightroom controls

After vignetting removal, the sky looks more natural and the bottom foreground tonality really opens up.  In general, the image is less claustrophobic with vignetting removed.

Vignetting 1: Overview

15 Sunday Nov 2015

Posted by Paul Duncan in Photography

≈ Comments Off on Vignetting 1: Overview

This is a somewhat detailed discussion of image vignetting, specifically characterizing it and correcting it.  Flat field images are used to quantify vignette characteristics, objectively compare several methods for vignette correction, and develop correction frames for the most accurate results.

Here’s our table of contents:

  • Vignetting 1: Overview (this post)
  • Vignetting 2: Parametric Correction
  • Vignetting 3: Correction Images
  • Vignetting 4: Photoshop Divide Layer
  • Vignetting 5: A Pathological Example
  • Vignetting 6: Other Options and Summary
flat field vignetting

A flat-field image was shot with a Lumix 20mm lens at f/2 on a Panasonic GH4 camera. Vignetting is obvious.

Flat Fields

Flat fields are images of flat, featureless, evenly-illuminated subjects that isolate the light falloff characteristics independent of subject or lighting.  Vignetting characteristics of a system become readily apparent in a flat field.

Opal glass used for shooting flat frames

An optical opal glass plate is about to be placed directly over a lens in preparation for shooting a flat field image.

Shooting a good quality flat field image is a little harder than you may think.  Any details sneaking in or uneven illumination corrupt the usefulness of the frame.  I generally shoot flat fields using optical opal glass which is a very efficient diffuser, much more so than ground glass for example.

  1. Point the camera at an evenly lit featureless subject such as a blank wall or overcast sky.
  2. Using manual or aperture-preferred mode, set the f-stop to the desired setting.
  3. Place the opal glass directly over the lens or lens/filter combination that you are calibrating.
  4. Focus on infinity and make an exposure within a stop or so of middle tonality.
  5. Process the raw image into a 16-bit uncompressed TIFF file using the same default settings you would use for any other image.

With flat field images made for the camera, lens, filter, and f-stop combinations of interest, we can take a closer look at the characteristics to plan strategies for correcting the vignetting.

Graphing Diagonals

Looking at a flat field image, imagine a line running from the center (brightest part of the vignetted image) to a corner (darkest tones due to fall-off).  If we graph the pixel values along this line, and do it similarly for each of the four corners of the image, we get a better grasp of how the light falls off from the center.

graph of light fall-off for Lumix 20mm lens at f/2

Pixel values from center to corners of an image are graphed to show fall-off for Lumix 20mm lens at f/2

For the Lumix 20mm f/2 example we’re using, we notice a couple of things.  First, each of the diagonals running from center to the 4 corners all have nearly identical fall-off characteristics—it’s radially symmetrical about the center.  (This is not always the case as we’ll see later.)  Also the fall-off is not linear:  it starts gradually and then falls off more quickly as you get closer to the corners.

Next we’ll similarly graph several f-stops for this lens for comparison.

A Lumix 20mm lens has light fall-off characteristics graphed for several different apertures.

A Lumix 20mm lens has light fall-off characteristics graphed for several different apertures.

Notice  the lesser amount of fall-off in the corners of the image at smaller apertures (higher f-stop numbers).  For this lens, the fall-off characteristics for all f-stops beyond f/4 are the same as the f/4 case.  (The curves are identical.) There is always vignetting with the lens regardless of f-stop.  But, for the larger apertures the fall-off is greater and the curves have slightly different shapes.

Histograms

histogram for 20mm f/2 flat field image

The histogram for the Lumix 20mm lens at f/2 shows the brighter central region on the right and the light falloff values toward the left.

The histogram for a flat field image showing vignetting is what you might expect.  The width of the tonal values indicates how extensive the light fall-off is.  For the most common forms of vignetting, the central region is the largest and brightest area, therefore showing the spike in tonal values toward the right side of the range.

Statistical Data

Statistical summaries of the pixel value numbers for an image give some useful insight, particularly when we’re looking for indications of the extent of vignetting and the success (or lack of it) in removing it. Photoshop shows some basic statistical summary data on the Histogram window.  For our purposes here, we’re going to use ImageMagick‘s identify command to display a very detailed list of information about the image:

identify -verbose image_file_name

For our Lumix 20mm f/2 flat field image we find the range of values to be 37.89 to 66.04 percent of maximum value (255 for 8 bit images, 65535 for 16-bit images).  So the range of values spans 28.15% of the full range of possible pixel values.  The standard deviation is 5.90.  When dealing with our flat field images, the standard deviation can give a simple single indicator of how successful we are in correcting vignetting.

The Perfect Flat Field

Having looked at the reality of our example flat field in several different ways, we can now look from the same perspective at what the ideal perfect flat field image would look like.

artificial perfect flat frame

A perfect flat field has no vignetting, and no variation in tonal values. This one is artificially created using 50% gray fill.

A perfect flat field (which practical reasons and physical laws prohibit the existence of) is perfectly uniform in tonal value from edge-to-edge and corner-to-corner.

When we apply various vignette correction techniques to our real-world flat field images, this is the ideal result.

Statistically speaking, the perfect flat field has a range of zero.  There is no variation, just the single tonal value throughout.  The standard deviation is also 0.

The histogram for a perfect flat field image would look like this:

Histogram for a perfect flat frame

A perfect flat field has a single pixel value throughout and so  the histogram has a single pixel-width column indicating that value.

All pixels are stacked in that one lonesome value with nothing else contributing any shape to the histogram.

Finally, a graph of the pixel value diagonals in the mythical perfect flat field is equally uninteresting.  Our flat field is flat-lined.

 

 

perfect flat frame diagonals graph

Pixel values from center to corners of a perfect flat field are uniform throughout and graph as a perfect flat line.

Next Up: Correcting Vignetting

Now that we have a better understanding of vignetting and a few different ways to quantify and characterize it, we can explore some ways to correct it.  That is, we want to turn our vignetted flat field image, that we shot with a specific camera, lens, f-stop, and filter combination, into the perfect pristine tonally-uniform theoretical flat field.  If we can do that, removing vignetting from our usual photographs should be straight-forward and effective.

We’ll take a look at several ways to do that and, armed with our visualization tools we’ve just described, assess how well the techniques do their jobs.

RSS Feed

  • RSS - Posts
  • RSS - Comments

Categories

  • General
  • Home Building
  • Outdoors
  • Photography
  • Uncategorized

Archives

  • February 2023
  • January 2023
  • December 2022
  • October 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • June 2021
  • May 2021
  • April 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • August 2018
  • July 2018
  • October 2017
  • September 2017
  • October 2016
  • July 2016
  • June 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • September 2015
  • August 2015
  • May 2015
  • April 2015
  • March 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • May 2014
  • April 2014
  • March 2014
  • January 2014
  • December 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • May 2013
  • March 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012

Copyright © 2022, Paul Duncan. All rights reserved.

Blog at WordPress.com.

  • Follow Following
    • Paul Duncan
    • Already have a WordPress.com account? Log in now.
    • Paul Duncan
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...