Chromatic aberration is caused by different refractive indices in the lens for different wavelengths. This is encountered frequently in refractive telescopes and telephoto lenses and in microscopes not equipped with achromatic lenses. There is no simple, general method for correcting for chromatic aberration. However, we can come close by making certain assumptions about the lens.
Chromatic aberration can be manifested in three different ways:
To correct this, tnimage can remove four types of distortion: shifting, linear stretching, radial stretching, and blurring. Each of these uses a parameter that must be determimed empirically for each image.
Shifting is done by moving all the pixels of one or more colors in the x or y direction. Negative x values correspond to ``left'', and negative y values correspond to ``up''. If zero is specified, no change is made. Typical starting value: -1.
Linear stretching is done by enlarging the R, G, or B channel by a specified factor, keeping the center point constant. A factor of 1.0 means no change for that color. The x and y stretch factors for each color can be specified independently. Typical starting value: 1.01.
Radial stretching is done by increasing the distance of the R, G, or B pixel from the center point by a specified factor. A factor of 1.0 means no change for that color. Typical starting value: 1.01.
Second-order radial stretching is not yet implemented.
Sharpening is done by applying a high-pass filter to the R, G, or B component. A value of 0 means no sharpening is done, while a value of 100 means maximal filtering. Typical starting value: 2.
Erosion makes objects of the specified color smaller. This is experimental. 0=no erosion 100=maximum erosion. Typical starting value: 1.
Notes
Images must be at least 16 bits/pixel for chromatic aberration correction to work.
Repeated stretching and shrinking of an image will eventually cause loss of resolution. Use the ``undo'' function to restore the image while searching for the correct parameters.
Excessive sharpening of one color may affect the overall color balance of the image.
Excessive erosion will make small objects disappear entirely.