Making Movies

Objective:

Outline a procedure for creating an animation sequence of images with PV-Wave. Then create a QuickTime and MPEG movie of that sequence that can be played on Window and Macintosh computers.

Procedure:

1. Make a color map with only 255 colors.
wave> m_color,255
**** Enter filename for altered color map ****
: sun_5_255.ascii
**** Use existing color / Choose new color (0/1) ****
: 1
**** Choose initial color map number (1-13) ****
:5

At this point a color palette appears and exercise#11 tells you how you can alter the palette if you want special colors. Press the right mouse button and the palette is saved in the filename sun_5_255.ascii.

1.1. Make a color bar that will be included in the final image.
where 255 -- the number of colors (avoid 256)
254 -- the background color (white)
0 -- the line&symbol color (black)

wave> m_bar,255,254,0
**** Enter filename for color map to be loaded ****
: sun_5_255.ascii

A small image of a color bar is shown and stored as "bar.byt".

1.2. Adjust the PV-Wave color table (map) to be used on the Mac by Format 1.01.
where 255 -- the number of colors is adjusted from 255 to 256 for Format 1.01.

wave> adj_ct_suntomac,255
**** Read-In ASCII Sun color-map filename ****
: sun_5_255.ascii
**** Write-out ASCII Mac color-map filename ****
: mac_5.ascii

1.3. Convert the ascii file to a binary file.

% cc atoi.c -o atoi.x

% cat mac_5.ascii | atoi.x > mac_5.bin
OR
% atoi.x < mac_5.ascii > mac_5.bin

If you look at the file size in bytes you will see that the mac_5.bin file is exactly 768 bytes: 256-red, 256-green, 256-blue.

1.4. Transfer files from the Unix workstation (Sun) to a Windows or Mac that has
Spyglass Format 1.01. Perform this transfer from the Mac or PC.

ftp> binary
ftp> get, mac_5.bin
ftp> get, bar.byt

2. This section outlines how to create an image sequence. In this project an
image sequence was created that showed Carbon diffusing into Iron using
PV-Wave software. To create this sequence:

  1. the fortran program, diff.f, generates and stores diffusion data in "concen.ascii"
  2. the fortran program, .extract.f, extracts data from concen.ascii and stores results in "concen.dat"
  3. the PV-Wave procedure, m_mov.pro, reads in diffusion data from concen.dat and creates the sequence of binary files (*.byt) where the animation sequence numbers are embedded in the file names. Embedded sequence numbers in filenames is necessary for Spyglass Format 1.01 to create a "pics" animation file.

2.1. Include the PV-Wave command lines shown below in your existing procedure.

; Begin time loop
for itime=1, final_time do begin
;
;....read in data to create images.......
;
; This set of commands create the filename
; with an embedded sequence number
openw,4,'temp.dat'
if (itime lt 10) then printf,4,format='(i1)',itime
if (itime ge 10) then printf,4,format='(i2)',itime
close,4
openr,4,'temp.dat'
nn=string(")
readf,4,nn
if (itime lt 10) then pp="image0"+nn+".byt"
if (itime ge 10) then pp="image"+nn+".byt"
close,4
openw,3,pp
img=assoc(3,bytarr(640,450))
;
;....create image in window with dimensions of (640,450) and avoid the
;....256th color......
window,1,xsize=650,ysize=450,colors=255
;
; Save image after inverting for applications on Mac
tmp=tvrd(0,0,640,450)
img(0)=rotate(tmp,7)
;
; End of time loop
endfor

2.2. You may want to check the first and last image to confirm the sequence.

2.3. Transfer these image*.byt files to a folder on the Mac.

2.4. Quit all other applications on the Mac and start up Format 1.01.

2.5. Select "New" under "File".

2.6. Adjust canvas size under "Special" (use previously recorded xsize, ysize
dimensions, preferably 640 x 450 pixels).

2.7. Select "Place Sequence" under "File" and find the folder where the image_*.byt
files are located and open the first image. The pixels for the byt images must be given again and an image will appear with the default (wrong) color. Shift the image to the upper left by using the mouse.

2.8. Under "Color" choose "Load color table" and select the mac_5.bin binary file
that you created on the Unix workstation. An image will appear that should look familiar except white--0 is assigned by the Format 1.01 for the background instead of black and the lines and symbols that were assigned a color of 254(white) are now effectively hidden by the white default background.

2.9. Select "Canvas color" under "Color" and slide down the vertical color bar until
255--black is observed. When the mouse button is released at 255--black the canvas background changes to black but cannot be seen until the transparent feature is selected.

2.10. To generate the transparent feature you must first click on the object in the
window with your mouse to select it. This is VERY IMPORTANT!!!

2.11. Now select "Edit Object" under "Edit" and select transparent by clicking on
the transparent box. Suddenly the background becomes black and the white lines and symbols can be seen.

2.12. If this is the first image (image_01.byt) select "Process animation" under
"File", a window will appear requesting a filename for the animation file. Choose "pics" as the file type. Save this file in a directory different from where the *.byt files are located.

2.13. With QuickTime ConvertToMovie create a QuickTime movie (using the
default settings).

2.14. With Sparkle create an MPEG movie. At first a prompt appears which can
be passed by clicking OK. Select "Open" under "File" and choose your QuickTime movie. Then select "Save" and remember to save your QuickTime movie as an MPEG movie. Then use the default settings to complete the formation of your MPEG movie.

NOW WASN'T THAT EASY!!!