Converting E3D Images to Movies

John Louie louie@seismo.unr.edu, 10/28/04

 

Purpose

This tutorial will help you convert sequences of images output by Shawn Larsen’s E3D seismic-modeling code to movies that you can play on a computer, like in a Powerpoint presentation.

 

What You Need

  1. A Macintosh computer with MacOS X. The tools described here exist in some form for UNIX and PC machines, but this tutorial only describes the conversion process on a Mac. Of course, this Mac will need access to the many megabytes of images created by an E3D run.
  2. The convimage or argbimage codes and script available here will reduce whichever component you process, one at a time, to red where positive and blue where negative; zero is white (left below, for an x component):
    1. To convert images written by E3D running on Intel hardware, get convimage.c and the convimage Darwin executable.
    2. To convert images written by E3D running on Sun or IEEE-binary-compatible hardware, get argbimage.c and the argbimage Darwin executable.
    3. An example shell script to convert a whole folder full of images is conv.sh.
  3. The 3compimage code and script available here will combine all three components to show the absolute value of component amplitudes with x red, y green, and z blue, with zero black (right below):
    1. 3compimage converts images written by E3D running on Sun or IEEE-binary-compatible hardware, 3compimage.c and 3compimage Darwin executable.
    2. 3compintel converts images written by E3D running on Intel hardware, 3compintel.c and 3compimage Darwin executable.
    3. An example shell script to convert a whole folder full of images conv3c.sh.
  4. Thorsten Lemke’s GraphicConverter application, Carbon (OS X) version 4.2.1 or later. An Apple-bundled version is available here, but you will probably need to obtain a licensed version of this shareware for $35 from www.lemkesoft.com.
  5. Apple Quicktime 6 Pro or later. You need to purchase the Pro upgrade for $30 from www.apple.com/quicktime.

Click on an image to see the final movie, for 10-sec waves in the Las Vegas region. There are also 8.8 Mb QuickTime and 5.7 Mb AVI movies of the Reno region for 2-sec, 3-component waves.

 

Running convimage or argbimage

The commands below should compile the codes on a Sun or MacOS X (use a Terminal window to access Darwin commands):

            cc -o argbimage argbimage.c –lm

     cc -o convimage convimage.c –lm

     cc -o 3compimage 3compimage.c –lm

You can run these codes on a Sun or on MacOS X. I don’t expect they will work without alteration if compiled under Linux on an Intel machine.

In a Shell Tool or Terminal window, cd to the folder where the E3D image files are. Alter the conv.sh script (below) to fit your job. Create subfolders called argb and jpegs with  mkdir argb and mkdir jpegs commands.

            #!/bin/csh

set files=( `ls profile.????.z ` )

foreach afile ( $files )

      ./convimage <$afile >./argb/${afile}.argb

     echo $afile converted

end

In 2nd line of this script profile is the root name of the image files, sometimes set in the E3D input file. You must change this to the root name of your files. The ???? denotes that all 4-digit image numbers will be accepted, and this script will only translate the z-component images.

I suggest running the script on one component at a time, and carrying through all the subsequent steps for that component. When you are finished with the movie for one component, remove the argb and jpeg files from their respective folders, change the z in the 2nd line to x or y, and run the script for the next component.

In the 4th line, this script runs the convimage program for Intel-binary images. Replace convimage with argbimage if you are translating Sun-binary images. Note that the binary must be present in the folder with the images. Run the script with a csh conv.sh command. Make sure you have sufficient disk space; each argb file will be almost as large as each original image file.

 

Converting to JPEGs with GraphicConverter

Start and register GraphicConverter. The options I use below are not available on unregistered versions. Select Convert:

 

In the dialogue that comes up there are several tasks (at least the settings are retained between sessions):

            Use the top left menu and the left file list to navigate to your new argb folder. Use the top right menu and right file list to navigate to your new jpegs folder.

            Set the Dest. Format menu to JPEG/JFIF, then press the Options…  button underneath. Set Quality: high and Progressive JPEG 6.0.

            Set the Filter menu to RAW. You should see your argb files now. Select the top file in the list on the left, and then shift-select the bottom file in the list. (You did remove all the other old files from other components?) So all the argb files from one component should be selected.

            Press the Convert button top center.

In the RAW format dialogue that appears, you enter the width of your image (should be n from the E3D grid input line, and is also reported by convimage and argbimage), set the Offset to 0 bytes, and press Guess. The guessed height should be the same as l or m from the E3D grid line.

            Set the format as Color, 32 Bit, ARGB; but uncheck Interlaced.

            Set Number Format as Motorola and press OK. For several minutes you will see GraphicConverter grinding through all the argb files in your subfolder.

 

Converting to a Movie with Quicktime Pro

Start and register Quicktime Player. The options I use are, again, only available to registered customers of the Pro version. Select Open Image Seguence…

In the Open dialogue, navigate to your jpegs folder, select the top file in the list, then shift-select the bottom file.

After you press Open, you will have the opportunity to select the frame rate. At least 10 frames/sec are needed for a movie viewer to perceive smooth motion. By combining this rate with the time dt and image movie setting for the E3D run, you can compute the modeled frames per second or seconds per frame. When the frame rate is set, a Player window will appear and you can try your movie.

 

E3D movies of map views, where the height is y, will need a top-to-bottom flip to have the right sense of north and south. Quicktime can do the flip for you. In Movie select Get Movie Properties. In that dialogue select Video Track on the left and Size on the right:

Click the Adjust button, click the up-down flip button below, and then click Done, and close the Properties dialogue.

 

Now save your movie. In the Save dialogue, make sure you check the Make movie self-contained button:

This movie should play in the free Quicktime player on both Windows and Mac, but not UNIX. For more compatibility, use Quicktime Pro’s Export function to save the movie as an AVI file with maximum-quality cinepak compression.