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. |
Transforms a spherical panorama to a fisheye view. |
last modified: December 15, 2018
USAGE: pano2fisheye [-p projection] [-v viewtype] [-d dimension] [-b bgcolor] [-f fade] [-s smooth] [-n newseed] infile outfile
-p ... projection ... fisheye projection type: choices are linear, stereographic, or PURPOSE: To transforms a spherical panorama to a fisheye view. DESCRIPTION: FISHEYE is designed to transform a spherical (equirectangular) panorama to a fisheye view. There are 3 choices for the fisheye format: linear, stereographics and orthographic. The spherical (equirectangular) panorama's pixels represent x=longitude and y=latitude. That is, both x and y are angular units. Longitude corresponds to 360 degree range. Thus the left and right sides must wrap contiguously. Thus a width to height aspect of 2:1. An image can be faked by cropping to w/h aspect of 2:1 (width is twice the height), then mirroring it horizontally, appending horizontally, then cropping the center half and rolling it horizontally 50%. ARGUMENTS: -p projection ... PROJECTION is the fisheye projection type. Choices are linear (l), stereographic (s), or orthographic (o). The default=linear. -v viewtype ... VIEWTYPE is the type of view. Choices are: planet (p) or manhole (m). The choice of planet is a view looking down from the sky. The choice of manhole is a view from the ground up. The default=planet. -d dimension ... DIMENSION is the square dimension of output image. Values are integers>0. The default is the height of the input. -b bgcolor ... BGCOLOR is the color for the area outside the circle of the fisheye region. Any valid IM color is permitted or the special name of "stars" to create a black background with random point star field. Use "none" to make the background transparent. The default=white. -f fade ... FADE is the amount of fade in pixels between the top of the input image and background color for viewtype=planet. This is a preprocessing step so that the outside of the fisheye circular region will fade to the background color. Values are integers>=0. The default=0. -s smooth ... SMOOTH is the amount of smoothing for antialiasing when bgcolor=none or stars. Values are float>=0. The default=0. -n newseed .. .NEWSEED is the random seed for creating the star field when bgcolor=stars. Values are integers>=0. The default is totally random star placement from run-to-run.
REFERENCES: NOTE: This script will be slow due to the use of -fx. 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 - Variation Of Projection For Viewtype=planet |
Original Image |
Arguments: -p linear |
Arguments: -p stereographic |
Arguments: -p orthographic |
Example 2 - Variation Of Projection For Viewtype=manhole |
Original Image |
Arguments: -p linear |
Arguments: -p stereographic |
Arguments: -p orthographic |
Example 3 - Viewtype=planet With Color Fade |
Original Image |
Arguments: -p linear -b #B4F2FE -f 100 |
Example 4 - Viewtype=planet With Stars |
Original Image |
Arguments: -p linear -b stars |
Example 5 - Viewtype=planet Composited On Background Image |
Original Image |
Background Image |
Arguments: -p linear -b none -s 2 -d 200 |
Compositing convert nebula_small.jpg \ 417327148_158bf17bf1_o_pano2fisheye_linear_planet_none_s2_f0_d200.png \ -gravity +430+195 -compose over -composite nebula_tiny_planet.jpg |
Example 5 - Viewtype=planet Pseudo Panorama |
Original Image |
Pre-Processing |
Arguments: -p linear -b #55B0F1 -f 20 |
What the script does is as follows:
This is equivalent to the following IM commands for the case of a linear fisheye.
|