Use of Unshake 1.4

Meerkat says - You looking at me,
mate?

  1. Launching with M/S Windows
  2. Launching with Generic Unix
  3. Launching with Mac OS X
  4. Basic Use of Unshake
  5. Explanation of the Controls
  6. Preparing Images for Deconvolution
  7. About the Sample Images
Please see the instructions for installation if things don't work out.

To Launch Unshake under Windows

  1. If you want to avoid browsing for them later, put the images (PNG, GIF or JPEG files) you want to Unshake in the folder called "source" in the Unshake folder.
  2. Double-click on the file in the Unshake folder called "Launch". This assumes that Sun's Java 2 is already installed in one of several standard locations. If it isn't, please read the Instructions for Installation.

To Launch Unshake under Unix (including Linux)

  1. If you want to avoid browsing for them later, put the images (PNG, GIF or JPEG files) you want to Unshake in the directory called "source" in the Unshake directory.
  2. In a terminal window, change directory to the Unshake directory, and run the shell script unlaunch.sh;
    [myname@localhost Unshake]$ ./unlaunch.sh
    
    This assumes that Sun's Java 2 is already installed and the file "java" is in your PATH. If it isn't, please read the Instructions for Installation, and put the Java 2 executable into your PATH environment variable.

    Alternatively, if java is in your path, you can launch Unshake from the command line with

     java -Xmx512m -jar Unshake.jar filename.jpg...
    

Hint

The incantation

 -Xmx512m
instructs the Java Virtual Machine (JVM) to allocate a maximum of 512 Megabytes to the process. Small images do not need this.

To Launch Unshake with Mac OS X

  1. If you want to avoid browsing for them later, put the images (PNG, GIF or JPEG files) you want to Unshake in the folder called "source" in the Unshake folder.
  2. Assuming that the launcher is correctly installed, and Mac OS X has not changed significantly since this version of Unshake was written, open the Unshake applescript icon which you set up on installation.

    If that isn't working, then you could do it the long way round, and open a terminal (Applications>Utilities>Terminal), then type

    cd /Applications/Utilities/Unshake
    chmod 755 ./unlaunch.sh
    ./unlaunch
    
    as you would under any Unix system (the "chmod" line only needs to be typed the first time you use Unshake).

Basic Use of Unshake

  1. Accept the terms displayed in the first window.
  2. At the bottom of the control panel is a list of files in the "source" directory (folder). If your image is there, click on it, and it will appear in a window. If the file is not listed, either click on "Open", to browse through your files, or Drag-Un-Drop (ahem) the file from a directory listing onto the source window.
  3. Choose how severely the image is blurred - "normal" or "severe". For guidance in settings, you could look at the examples which will be published, e.g. at the current home or at www.unshake.co.uk, but briefly, "severe" is moderate shake or very bad blur, anything milder is "normal", anything worse means you should shrink the image with an image processor before applying Unshake to it.
  4. In general it is safest to leave the "quality" set to "Estimate", but see below, under controls.
  5. A new feature in version 1.4 is that you can tell the program what you think is the most important part of the image to concentrate on. Change the shape and size of the window which holds the image, and use the scroll bars, until the window only contains parts of the picture which are blurred in the same way as the part of the image in which you are interested. For example, if the picture is a portrait of someone, but you want to focus on the background, make sure that everything in the window is background.

    The window should not be too small, however - 200 by 200 pixels is a reasonable minimum, and if you can make it larger without including parts of the picture which are blurred differently, then that would be much better.

  6. Another new feature of Unshake 1.4 is that you can say how long you want to wait for the answer. Click on "Estimate", and after a few seconds' calculation, you will see an estimate of how long a basic deconvolution of the picture will take, assuming that you have enough RAM and no other programs are running. To the right of that number, you can choose how much longer you are prepared to wait - from "x1"="the estimate", through "x2"="twice as long", to "x100"="I will wait until it is finished, or 100 times as long as the estimate, whichever is sooner". I use "x1" for a first preview, and "x100" after that for the "best" result - it has never yet really taken 100 times as long - the option is there as a guarantee that the program will give its best result.

    The numbers are only approximate.

  7. Click on DeBlur.
  8. Wait. The windows will seem dead for a while. Eventually you will get Unshake's estimate of how the picture should have looked, if it hadn't been blurred. The result will be saved if possible in the directory ("folder") called "results", as a JPEG file with the same name as the original.
  9. To save the result anywhere else on your computer, click on "Save". (D'oh!)
  10. If you wish to change the amplification (which gives more clarity, but risks distorting the image), click on ReDraw afterwards to redisplay the image.
  11. If the image contains clearly repeated structures, like a stand of upright trees, or railings, then they may have been mistaken for shake, and removed or distorted. To prevent this, change the view in the window, and click on DeBlur again. Alternatively, if "haloes" appear around features, you may need to select "severe blur", or to enlarge the window, or you may be asking for the wrong quality - as a last resort, try requesting "basic" quality or "portrait" instead of "Estimate Quality".

    Another sign that something may be wrong is if, scrolling down the centre panel of the controls, you see "Quality Estimated 1.5". This may indicate either of the above problems, or that the window or image is too small. (This happens for the picture "Sols.jpg", unless you use "Portrait" mode or "Severe blur".)

  12. To close Unshake, close one of the windows.

Controls

Preparing Images for Deconvolution

It is best to start with your own pictures, and to scan them into your computer if you can. First, note that Unshake works with pictures with widths and heights of 64, 128, 256, 512... pixels. If you give it a picture with a width of 257 pixels, it will pad it out (with an averaged colour) to 512 pixels, and will take much longer to process it than it would a picture with a width of 256 pixels. (This is a property of the Fast Fourier Transform algorithm which it uses.) 2048 by 2048 is the largest image which can be processed at the moment.

Crop all borders and edges from the image, and try to avoid features added after the picture was taken, such as writing. The reason for this is that such features are usually sharp, and so become distorted when the rest of the image is sharpened.

Try not to adjust the brightness and contrast of the picture, or if you must, ensure that the "gamma" is set to be linear - this may be indicated by a straight line on a graph. Failure to do this puts ripples or ghosts around edges with high contrast.

A disclaimer: Unshake has difficulty with images which are overexposed, underexposed, twisted (meaning that the image turned round an axis between the camera and the subject), or covered in fluff. So don't try to process images of playful black kittens in coal-sheds at night, after the kitten has walked across your scanner.

When you save the picture, use Portable Network Graphics (PNG) format, if your installation can use it. Failing that, either use GIF or JPEG format. JPEG is the best of the two , but there is a catch - JPEG encoders smooth out the picture a little, not enough for a human to notice, but this destroys the information which Unshake uses to reconstruct the image. It's best to include as much information as you can in the file, by specifying "100 percent quality" (you may find this under 'options' in your scanner's menu). It is generally recommended that you don't use 100 percent for normal purposes.

PNG images are used increasingly. These are preferable to both JPEG and GIF, but don't expect people with different installations to be able to use them.

If you use images from the web, you have no choice over how they were compressed, but you should be aware that Unshake may have difficulty with JPEGs, if they have been highly compressed. (There is no real problem that Unshake saves files in JPEG format, because by that stage all of the useful information is included in the JPEG. This version of the program also creates much more detailed JPEG files than people normally use.)

Once you have saved the image, you will probably want to copy it into the "source" directory (called a "folder" under Windows). Then start Unshake, as above.

About the Sample Images

© M.D. Cahill 2000-2003.