Original image | Lensed image |
This is the original image, the galaxy M 33 taken from the STScI Digitized Sky Survey and placed on a painted starry background. Click on a blue button of the bar to apply the gravitational lens (buttons below the galaxy's center give the most dramatic results) or scroll down to find more about what the individual frames show and how they were created. |
A great thing with the Adobe Photoshop, a powerful software for editing electronic images, is that its capability can be enormously expanded by adding new plug-in filters. To a quantitatively-oriented user and amateur astronomer like me, Filter Factory plug-in by Joseph Ternasky and Dave Corboy is of special interest. It lets users to create their own filters with a simple internal programming language and compile them as separate files.
Gravitational Lenser 1.3, a photorealistic simulator of a point mass, weak and thin gravitational lens, is such a plug-in filter.
The plugin should be also accepted by these graphical
programs: Adobe PhotoDeluxe, Ulead PhotoImpact, Animator Studio,
Corel PhotoPaint 7.0+,
I haven't been able to compile Gravitational Lenser 1.3 for Mac users yet, but they can try a gravitational lensing filter created by Pete Kernan (Case Western Reserve University).
Download •
If you want your own copy of Gravitational Lenser 1.3 for Windows, just download the file grlens13.zip (about 24k) from this page.
Distribution of Gravitational Lenser 1.3 is allowed as long as the file grlens13.8bf is left intact and free for ultimate users. Commercial redistribution without prior consent of the author is forbidden. No warranties are given.
Extract from the zip archive the plug-in itself, the file grlens13.8bf, and copy it into your plug-in directory (usually C:\PHOTOSHP\PLUGINS). Next time you run Adobe Photoshop, it will recognize a new category in the Filter menu, Astronomy, with Gravitational Lenser 1.3 in it. Note that the filter is available only if you have a RGB (16.7-million-color) image opened, since it doesn't work with other types (in particular grayscale images or indexed color GIFs).
Visit
PC Resources for Photoshop to learn how Gravitational Lenser 1.3
should be installed in Adobe PhotoDeluxe, Ulead PhotoImpact, Animator Studio,
Corel PhotoPaint 7.0+,
This is the menu of Gravitational Lenser 1.3:
The actual range is [0,X] and [Y,0], where X is the width and Y is the height of the image in pixels. Note the reversed limits of the vertical shift slider – the origin of the coordinate system (x=0, y=0) is in the top left-hand corner of the image. The default value for the first two sliders is 128, understood by the filter as X/2 and Y/2, respectively, that is the image's center.
The basic characteristic of a gravitational lens with circular symmetry (see below). The slider changes it from 0 to the minimum of X/2 and Y/2. For example, when the image you are lensing have width (X) 1000 and height (Y) 1200 pixels, and the slider shows 51, the Einstein radius of the applied gravitational lens is 100 pixels, because (51/255)*(1000/2) equals 100.
Since Gravitational Lenser 1.3 is intended first of all as an educational tool, it adds a circle of the Einstein radius to the lensed image. Its RGB color can be changed by the last three sliders. The default color is R=255, G=255, B=255, nothing else than pure white. The same color applies also to a strangely shaped area around the lens. This is an undefined area where the filter tries to map pixels from outside the image. Curiously enough, these sliders shows the actual values!
An attempt to model with Filter Factory the appearance of the starry skies during a fall into a black hole would give you a pretty hard time, but a typical gravitational lens is fortunately much easier to code. Under most circumstances, we can take advantage of several considerable simplifications (not independent of each other):
Makes use of the fact that most of the light deflection occurs within a distance from the lens which is comparable to the impact parameter and much smaller than the total length of the light path from the source to the observer. The lens is no longer considered a three-dimensional object. Instead, it is approximated by a thin mass sheet perpendicular to the optical axis, referred to as the lens plane (yellow in the Figure 1 below). The effect of the lens depends only on projection of its mass to this plane. The light ray consists of two straight lines which meet at the lens plane.
Assumes that the angles b, h, and the deflection angle a are very small and their tangents can be replaced by the angles themselves (measured in radians). Note this condition is intimately related to the thin screen approximation – given the distances between the observer and the lens, and the lens and the source are required to be much greater than the impact parameter, the light ray can reach the observer only if the deflection angle is small enough.
Requires that the light passes through a weak field with the absolute value of the Newtonian gravitational potential much smaller than the square of the speed of light c. In addition, the relative (peculiar) velocities of the observer, the lens and the source must be much smaller than c.
Again, this is related to the small angles approximation because the weak field implies the small deflection angle.
Considering the above simplifications, and the fact that the first version of Gravitational Lenser models a point mass lens, we can derive the following relation between the angles b, h, and a called the lens equation (see the Derivation of the Lens Equation page for details):
Sometimes you can meet a slightly different form of this equation
where â = aD_{3}/D_{1} is called the reduced deflection angle.
Perhaps the most elegant form of the (point mass) lens equation is this one:
where we introduced the Einstein radius
In a general case, the lens equation has two different solutions corresponding to two images of the source:
h_{2} = (b – (b^{2} + 4e^{2})^{1/2}) / 2
If the lens and the source are perfectly aligned (b = 0), we still formally get two images at the same distance from the lens
but in reality the source is imaged as a light ring of the Einstein radius (called the Einstein ring) because the problem is now circularly symmetric and no position angle is preferred.
The lens equation is surprisingly easy to code with the Filter Factory programming language. If the lens characterized by the Einstein radius of 100 pixels is situated in the middle of the image, the entire code reads as follows:
G: rad(d,m–100*100/m,z)
B: rad(d,m–100*100/m,z)
(Note that since gravitational lenses are achromatic, the code is identical for all three colors R, G, and B.)
Mathematically speaking, the Filter Factory statement
r_{old} = function_{2}(r_{new})
In particular, the statement
leaves the image as it is, while the statement
enlarges it twice.
For those familiar with Filter Factory programming, here is the complete source code of Gravitational Lenser 1.3:
put(x-val(0,0,X),0),put(y-val(1,Y,0),1),
put(get(0)*get(0)+get(1)*get(1),2),
put(val(2,0,min(X/2,Y/2)),6),
put(get(0)*get(6)*get(6)/get(2),3),
put(get(1)*get(6)*get(6)/get(2),4),
put(sqr(get(2))==get(6) || get(2)==0 || (x-get(3) > X)
|| (x-get(3) < 0) || (y-get(4) > Y) || (y-get(4) < 0),5),
get(5) ? ctl(3+z) : src(x-get(3),y-get(4),z)
G:
get(5) ? ctl(3+z) : src(x-get(3),y-get(4),z)
B:
get(5) ? ctl(3+z) : src(x-get(3),y-get(4),z)
If you wish to modify the filter to satisfy your curiosity or needs, feel free to do it. To save you from having to type the lengthy code, I have included the source file grlens13.afs in the zip archive.
I am trying to model
with Filter Factory more complicate lenses. Despite
limitations of this programming tool, in particular its
integer mathematics, I believe it can accomodate
a code for a good simulator of elliptical lenses described by
equations of
Here is what I found with Alta Vista about interplay between light and gravity. Needless to say, the list is quite incomplete and your suggestions will be welcome.
If your browser supports Java (not JavaScript), visit this interactive webpage to lens an astrophysicist's portrait or an image anywhere on the Web. Cool!
Hosted at the University of Liège, this site offers among other things bibliography of lensing papers (available in PostScript or Latex format), list of gravitational lens systems and gallery of their images. Unfortunately, the Didactical Experiments page seems to be under permanent construction and contains nothing but an abstract.
Detailed tables of observational and model parameters of gravitational lens candidates (and binary quasars as well) plus images from the HST.
Web home of the gravitational lensers at the Max-Planck-Institut für Astrophysik. Miscellaneous stuff, including on-line articles and preprints, links to other sites (try a microlensed kangaroo by Joachim Wambsganss), and the interactive search form for lensing literature.
Amazing travel beyond the weak field and small angles approximations by Robert Nemiroff (Michigan Technological University). Short movies (in mpeg format) show the starry skies from an orbit around a neutron star and a black hole. An on-line article by the same author, originally published in the American Journal of Physics, gives background information.
Chapter #10, Illuminations, of Jean-Pierre Luminet's popular book Black Holes (Cambridge University Press, 1992). What happens when light approaches these relativistic beasts.
Cool introductory course by Ramesh Narayan (Harvard-Smithsonian Center for Astrophysics) and Matthias Bartelmann (Max-Planck-Institut für Astrophysik). Technical, but approachable.
I am indebted to Werner D. Streidt for his writting Filter Factory FAQ. I knew nothing about this programming tool before I accidentally found his FAQ on the Web. They were the source of general information on Filter Factory on this page. The version 1.3 is much faster then the previous one (1.2) thanks to code improvements made by Kangaroo and Mario Klingemann. Thanks!
Go to Leos Ondra's Home Page. | |
Leos Ondra ondra@bm.cesnet.cz May 1, 2000 |