Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial (non-profit) use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php Please read the Pointers For Use on my home page to properly install and customize my scripts. |
Performs filtering on an image in the frequency domain. |
last modified: May 12, 2019
USAGE: fftfilter infile filtfile outfile No options are required. PURPOSE: To perform convolution on an image in the frequency domain. DESCRIPTION: FFTFILTER performs filtering on an image in the frequency domain using a frequency domain filter image. Two inputs are required. The image and a grayscale frequency domain filter. The image is transformed to the frequency domain using -fft and the filter image is then multiplied with the Fourier transform of the image and the product is then returned to the spatial domain using -ift. Any alpha channel on the filter will be removed automatically before processing. If the image has an alpha channel it will not be processed, but simply copied from the input to the output. ARGUMENTS: None The filter image must be appropriately centered and padded with black to the same size as the input image. REQUIREMENTS: IM version 6.5.4-7 or higher. HDRI is not required, but Q8 compilations of IM are not recommended as it will not carry enough precision. Also requires the FFTW delegate library. LIMITATIONS: This script works well only with even, square images. Otherwise, the FFT will pad them with black to conform. However, there will be excessive ringing due to the color discontinuity associated with the padding. This even, square limitation is a ramification of the current IM implementation that needs addressing at some future time. It is not a limitation of FFTW. See Fourier Transform with ImageMagick, for more details. CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk. |
Gaussian Blurring - Low Pass Filtering |
||
Input |
Filter |
Arguments: |
Gaussian Edge Detection - High Pass Filtering |
|||
Input |
Filter |
Arguments: |
Post Processing: |
Simple Binary Notch Filtering |
||||
Input |
Spectrum: |
Masked Spectrum: |
Filter: |
Arguments: |
Notch Filtering With Tapering |
||||
Input |
Spectrum: |
Masked Spectrum: |
Filter: |
Arguments: |
What the script does is as follows:
This is equivalent to the following IM commands.
|