components.photo.vignettecorrector

pyctools.components.photo.vignettecorrector.VignetteCorrector Vignette corrector.
pyctools.components.photo.vignettecorrector.AnalyseVignette Vignette analysis.
class VignetteCorrector(config={}, **kwds)[source]

Bases: pyctools.core.base.Transformer

Vignette corrector.

Adjust the brightness of images with a radially varying gain function. This should be applied to ‘linear intensity’ image data before gamma correction is applied.

The range config item specifies the input and output video ranges. It can be either 'studio' (16..235) or 'computer' (0..255).

The r2r8 parameters set how the correction varies with radius^n. The first affects the whole picture, the higher powers have more effect at the edges. The AnalyseVignette component can be used to generate an optimised set of values.

Config    
range str Nominal black and white levels. Can be 'studio' or 'computer'.
r2 float Amount of radius^2 correction
r4 float Amount of radius^4 correction
r6 float Amount of radius^6 correction
r8 float Amount of radius^8 correction
class AnalyseVignette(config={}, **kwds)[source]

Bases: pyctools.core.base.Transformer

Vignette analysis.

Measures the average luminance of 50 circular bands of an input grey image, then calculates the optimum r2rn parameters to correct it. This is easier to use than trying to set the parameters manually.

The order parameter can be used to adjust the number of coefficients produced. It is probably a good idea to use the smallest number that gives acceptable results.

log_eps controls the fitting of the polynomial. If it is too negative the polynomial will be a very tight fit but the coefficients may have very large values and change wildly when there is a small change in input. See numpy.polyfit for more detail.

The function output emits the measured and fitted gain functions. It can be connected to a PlotData component.

Config    
range str Nominal black and white levels. Can be 'studio' or 'computer'.
order int Number of r parameters to generate.
log_eps float Base 10 logarithm of relative precision.

Comments or questions? Please email jim@jim-easterbrook.me.uk.