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. |
Applies a conformal mapping to an image |
last modified: January 17, 2022
USAGE: conformal [-d dimensions] [-f formula] [-g gain] [-v vp] [-b bcolor]
[-z zcolor] [-m monitor] infile outfile
-d ... dimension ... output dimensions WxH; "x" separated pair of integers>0; PURPOSE: To apply a conformal mapping to an image. DESCRIPTION: CONFORMAL applies a conformal mapping to an image. The user may select from on of 7 complex expressions. The virtual pixel method may also be selected. ARGUMENTS: -d dimension ... DIMENSIONS specify the output image dimensions WxH. The value is an "x" separated pair of integers>0. The default=input dimensions -f formula ... FORMULA is a flag for the complex expression. Value are integer between 1 and 8. 1=-1/z, 2=(z+1/z)/2, 3=z^2, 4=sin(z), 5=cos(z), 6=ln(z), 7=(z+1)/(z-1), 8=1/(4*z^2-1), where z=x+i*y is a complex value. The default=1. -g gain ... GAIN is a gain factor (zoom) that controls the look of the conformal mapping. Values are a pair of comma separate floats>0 as "xgain,ygain". If only one value is provided it will be used for both. The default="1,1". -v vp ... VP is the virtual-pixel method. Any virtual-pixel method is allowed. The default=tile. -b bcolor ... BCOLOR is the background color for the virtual-pixel method that is a color. Any valid IM color is allowed. The default=black. -z zcolor ... ZCOLOR is the zero color, which is the color for where the formula has a divide by zero. Relevant only to formula 1, 2 and 6. The default=black. -m monitor ... MONITOR enables the progress monitor. Choices are: on or off. The default=off NOTE: This script will be slow due to the use of -fx. On my Mac Mini with two cores, it took about 10-15 sec for a 500x500 image.
REFERENCES: 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. |
Example 1 -- Formula 1 -- -1/z |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
Example 2 -- Formula 2 -- (z+1/z)/2 |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
Example 3 -- Formula 3 -- z^2 |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
Example 4 -- Formula 4 -- sin(z) |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
Example 5 -- Formula 5 -- cos(z) |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
Example 6 -- Formula 6 -- ln(z) |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
Example 7 -- Formula 7 -- (z+1)/(z-1) |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
Example 8 -- Formula 8 -- 1/(4*z^2-1) |
Original Image |
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
|
Arguments: |
What the script does is as follows:
This is equivalent to the following IM commands:
|